ubuntu.com icon indicating copy to clipboard operation
ubuntu.com copied to clipboard

Add support for mermaid diagram for content fetched from Discourse

Open deusebio opened this issue 2 years ago • 3 comments

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

deusebio avatar Oct 02 '23 20:10 deusebio

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

immortalcodes avatar Oct 01 '24 08:10 immortalcodes

Hey @deusebio , I am closing this issue but please feel free to re-open with more context and updated links

immortalcodes avatar Oct 03 '24 19:10 immortalcodes

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 avatar Oct 03 '24 19:10 deusebio

@deusebio The above links appear to no longer work. Can you provide more relevant examples please?

petesfrench avatar Jul 01 '25 07:07 petesfrench

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.

deusebio avatar Jul 01 '25 19:07 deusebio

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.

petesfrench avatar Jul 02 '25 08:07 petesfrench

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.

RokeJulianLockhart avatar Jul 02 '25 09:07 RokeJulianLockhart

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.

petesfrench avatar Jul 02 '25 14:07 petesfrench