Add support for mermaid diagram for content fetched from Discourse
Summary
Some of the documentation that is fetched from Discourse contains mermaid diagrams. Support for these have been added to other frontend platforms (e.g. charmhub.io, see here). It would be nice to have the same functionality in ubuntu.com as well.
Examples are:
- https://charmhub.io/postgresql-k8s/docs/e-charm (fetching data from https://discourse.charmhub.io/t/charmed-postgresql-k8s-explanations-charm-flowcharts/9305)
Current and expected result
Right now mermaid diagram are rendered showing the code, e.g. https://ubuntu.com/data/docs/postgresql/k8s/e-charm. It would be nice to render them similarly to charmhub.io: https://charmhub.io/postgresql-k8s/docs/e-charm
Hey @deusebio , The pages that you have linked here no longer exists, could you please help find new pages so this could be understood better. Thanks
Hey @deusebio , I am closing this issue but please feel free to re-open with more context and updated links
Sorry I've been travelling in the past few days. Here is an example:
Charmhub
- https://charmhub.io/postgresql-k8s/docs/e-flowchart-charm
ubuntu.com
- https://canonical.com/data/docs/postgresql/k8s/e-flowchart-charm
Could you please re-open @immortalcodes ?
@deusebio The above links appear to no longer work. Can you provide more relevant examples please?
Hi @petesfrench!
Thank you for flagging this out! Yes, I believe the docs are currently being moved to readthedocs, therefore the links won't probably work from now on. Given the migration, the issue won't be affecting us looking forward but I suppose the issue may still be impacting others that have their docs still in Discourse/Charmhub.
But, given this, up to you whether it is worth keeping this issue open or not.
Hi @deusebio, thanks for clarifying. If there is not a direct request for the work we will not be picking it up. For this reason I will close this issue.
https://github.com/canonical/ubuntu.com/issues/13192#issuecomment-3026909220
@petesfrench, all you'd need to do is add meta.discourse.org/t/mermaid-js-plugin/88696 to Ubuntu's Discourse instance, if I've understood the request correctly. It wouldn't be more 20 minutes of work.
Thanks @RokeJulianLockhart, but I don't think we should be adding unnecessary plugins to our discourse instances. If a someone comes forward with a legitimate use case, then we can definitely include it. It would also not be so trivial as the discourse instance is hosted by IS so would require going through them. I imagine we would also have to update our discourse parser to be able to display it on our sites.