asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

Mermaid preview to also support GitHub syntax [source,mermaid]?

Open gesinn-it-gea opened this issue 2 years ago • 8 comments

The built-in Mermaid preview works very well in PhpStorm using a [mermaid] block. Unfortunately, on GitHub, Mermaid diagrams are only rendered if they are included with [source,mermaid]. Is there a way, to support the GitHub syntax also for this plugin?

See also:

  • https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/
  • https://gist.github.com/plamentotev/be495e81abd52dc10e7dd51fbb71dd8c

gesinn-it-gea avatar Nov 06 '23 13:11 gesinn-it-gea

Thank you for investigating this. I'll have a look. Stil this seems to be a rather strange behavior on GitHub.

Did you find an issue on GitHub where this behavior for AsciiDoc is being discussed, and maybe a fix is being tracked?

ahus1 avatar Nov 26 '23 21:11 ahus1

Thanks for looking into this! No, I am not aware of this topic being discussed on GitHub. The type of integration on GitHub with the naming of an explicit "Source" block is probably not easy to change there. If this could be changed here on the plugin side with manageable effort, that would be great!

gesinn-it-gea avatar Nov 27 '23 08:11 gesinn-it-gea

I had a look and tried both asciidoctor-diagram and Kroki for rendering the diagram with [source,mermaid] - none of them does. It also feels wrong, as source outputs the source code as is, and sometimes with syntax highlighting.

I see that there is a discussion to workaround with ifdef/ifndef, and I assume this is the way you'd need to go here. I don't plan to make changes to the AsciiDoc plugin while both asciidoctor-diagram and Kroki don#t support it.

I suggest you open a issue against GitHub to have it fixed on GitHub, and possibly link it here so people can follow that link. Once there is such an issue, I'll close this issue.

Please let me know what you think.

ahus1 avatar Dec 17 '23 14:12 ahus1

Really interested by a solution to this problem too. Is there already an issue reported to GitHub?

davinkevin avatar Feb 01 '24 12:02 davinkevin

@davinkevin - I assume there isn't. Please go ahead and create one, and then link it here! Your efforts would be appreciated.

ahus1 avatar Feb 04 '24 20:02 ahus1

Done, however it doesn't appear in the UI here as a related issue…

The support request id is #2582237

davinkevin avatar Feb 07 '24 07:02 davinkevin

And now it's here: https://github.com/orgs/community/discussions/106933

davinkevin avatar Feb 09 '24 16:02 davinkevin

Thank you for taking the time. I upvoted it, and I encourage everyone else interested in that to do the same.

I also added additional references.

ahus1 avatar Feb 10 '24 12:02 ahus1