MermaidJS diagrams in discourse

Problem statement

A diagram is often much more meaningful than a long text…

I have seen on this forum very engaged users who sometimes explain very complex flows, and it generates a lot of explanations and back and forth comments.

I have seen myself editing diagrams online and then cut & paste the resulting image in a post. The problem is then that if I need to update / change the diagram I need to restart my diagram from scratch if not saved elsewhere.

Proposal

MermaidJS is a javascript library which goal is to easily define diagrams with a markdown-like syntax.

There is a discourse plugin, and it will enable to possibility to do things like that in any post:

[mermaid]
sequenceDiagram
	Main Screen->>Song Config Screen: Click config Icon
	Song Config Screen->>Song Config Screen: wheel down to mode
	Song Config Screen->>Song Config Screen: Select 6x6
	Song Config Screen->>Main Screen: Validate new config
[/mermaid]

and it will display it like that:
image

Another example:

[mermaid]
graph LR
	A[Amp] -->|Effect loop| B(Aeros)
	B --> C(Multi-tracks recorder)
	C --> D(etc...)
[/mermaid]

and it will display it like that:
image

I don’t know if you have the possibility to manage your own discourse plugins (probably depends on your hosting plan), but such a feature would be super cool and very helpful to describe things that are sometimes a bit tricky…

I already requested a very simple discourse plugin that looked very easy to implement (as directly available from the discourse plugin market place for free and for all hosting plans…), but with no success :sob: . Probably that one is a bit more complex to add if you don’t host your own instance. But in any case if you request people from discourse to add it, it may be feasible.

I really think that it would bring something…

2 Likes

Since I cannot implement either of your requests for Discourse plug-ins, I forwarded them to Singular Sound. If they approve, they will implement.

Thank you @persist,

@BrennanSingularSound, I know this is probably a bit secondary compared to ongoing firmware topics you have to implement, but take a look at the last discussions we have been participating to and tell me that this kind of stuff would not bring meaning and clarity to a lot of requests you have been receiving (or even replies you may have had to do)…

It is definitely not a priority right now, but I can look into it. Not sure how used they will be (or if I’ll regret giving so much creative power to the forum :sweat_smile:) but I don’t see why not.

1 Like

To be used, it would probably just need to be advertised :wink: . And I don’t really think you would give more power to the user, after all people could already build the schemas online and then copy/paste the result. That’s basically just a question of comfort.

There are many tools supporting that library already like Gitlab, Confluence, and many others. What they have in common is the fact these are tools used to express ideas, which seems to be the case in this forum.

I clearly understand the low priority of this , but try not to throw it away.

I’m actively looking into it, I believe that one of the pro’s of moving to Discourse is that they’ll install things like this for us, so I just shot them an email, otherwise it doesn’t look too hard to do and we’ll try and implement sooner rather than later.

Update: Discourse doesn’t support plugins given our current tier, and the next tier costs $1500 a month!

However, we have a couple of avenues to pursue that we will be trying first. Either way, definitely something we see as valuable and having on the forum. :slight_smile:

2 Likes

Wow… Maybe it worth then wondering if hosting it by yourself is not more interesting… Discourse is a simple RoR application, and there are even ready-to-deploy DigitalOcean droplets which are pretty good alternative to full blown server management … and probably for a fraction of the price (I don’t have your figures in terms of storage / CPU usage and bandwidth).
I am not saying you should do it, it depends a lot of your available internal resources/skills, and discourse is a nice application with a standard open source business model that I respect a lot. Just saying you should wonder.

Yeah - we’re investigating. Discourses support is great, and the team has worked with us in several ways in the past so we’ve got some loyalty to it + the current tier isn’t bad for a fully manged solution. So we have one thing we’re going to try while remaining on the current tier.

If that doesn’t work we’ll start investigating some other hosts.

Hello @AnthonySostre . Any news on this front ?

The method of getting the plugin installed while remaining hosted at disourse.com doesn’t look like it will work, so we’re reaching out to other hosts this week that will allow this.

Thanks for the update

Hi Anthony I hope you are well.

Unless I’ve completely misunderstood, am I correct in saying that to enable this or any other plugin it would require a server migration? If so, I’m just wondering whether we should check with the community if this is going to be used by many people because that this sounds like a bit of a risk.

That’s what I understood too…

I actually didn’t request that… That was a simple javascript add-on I was requesting, not a server migration which always adds risks. AFAIK a discourse migration would imply:

  • a postgresql database dump/reload
  • a copy of the repository of attachments (images, videos)
  • a DNS update (always expect some kind of outage for certain users due to DNS propagation issues)

The two first parts can be mostly done or at least rehearsed in advance, yet at some point you need to determine a cut-over time, and set the original forum to read-only while copying to the destination.
Nothing very complex but I agree with you this is a migration and every migration implies risks.

If there are other expected returns on investment from this migration, I would say go for it. If it’s just to please me, even if I think this feature would really rock, then forget about it…

1 Like

Yeah it would entail a server migration, there are some other benefits to it:

  • it’s cheaper for us
  • we can add many plugins, not just this one
  • we’d have higher bandwidth/storage limits (we’re not necessarily close to hitting ours, but it’s something that’d be nice to have especially for the future of the forum).

Yes, there is always a risk in migration, and the host I’m talking to was recommended by Discourse.com themselves. They’d handle the migration and exactly as you said, handle the first two in advance where we can test and ensure there’s no issue. Since we’re going from Discoure to Discourse there’s less risk than past migrations we’ve done as well.

As far as the DNS update, I rarely find that it takes more than a couple of hours now-a-days and would have no issue staying up till 2 or 3 AM in the morning one night to get the change made and propogated while most forum users are sleeping.

Definitely we will do a poll here on the forum before making any decisions. Right now I’m just in the information gathering stage, and as we transition into the decision making stage I’ll make an announcement and see your opinions. (likely with a Google Poll)

1 Like

Cool. As I said if you get extra benefits, go for it !

Just curious, can you disclose which one you selected ?

DNS propagation depends a lot on which ones you’re using… There’s is no strict rule there…
Time window, is a matter of where you got most of your users. For me it would mean 8 to 9AM (I am in France)

As long as it does not require a FB, Twitter, Google, Apple or whatever type of GAFAM account… I’ve banned all of these a long time ago…

1 Like

Had to look up GAFAM (It appears to be a French specific Acronym, but I could see it being used in the states soon. Definitely something I’ll use going forward), the poll wouldn’t require an account - it would be anonymous.

On another note, I’m interested in discussing why you’ve banned them more and what alternatives you use, though maybe not in this thread so we don’t flood it with unrelated stuff. It’s something I’d probably do to if my job wasn’t marketing where I have to keep accounts there for work purposes.

Replied to you via PM

Hello @AnthonySostre,

Could you please update us on this server migration and Mermaid availability ?
Thank you in advance

I’ve been sick for a while and didn’t want to do a migration when I wasn’t around to ensure it’d go smoothly. We are planning to migrate September 3rd at 8AM EST. The Mermaid plugin should come shortly after. :slight_smile:

1 Like

I hope you’re better now!