Closed mklueh closed 1 year ago
Thanks for suggesting this. I'll look into this, still I can't promise a date for this yet.
The new option is now available in the settings:
I'll update this issue once a pre-release is available.
Version 0.38.2 is now available as a pre-release. Please give it a try and let me know how this works for you.
If it works well and we don't consider it to be experimental, I might enable it by default in a future release.
The pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository.
Works on my machine (Fedora, Goland 2022.3, asciidoc plugin 0.38.2), thanks!
Tested using:
[mermaid]
....
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
....
Resulting in the expected
Hi - thanks for confirming that this is working for you! I plan to publish a new release to cover some changes needed for 2022.3 this weekend or early next week, and then those changes will be available to the general public.
Just one small thing, it seems you need to restart the IDE after enabling the new function, but there is no hint or anything. It just does not render at all and you wonder why. But maybe there was another reason, as nothing was rendering at all
do you need a complete restart of the IDE, or does it also work when you close and re-open the relevant file (I noticed you sometimes need to close and re-open a file when changing an option related to the filetype already opened)
@jop-di Not sure anymore, but I think the first time after updating the plugin and activating the new feature it was a reboot. Then I witnessed I had to close and reopen each file after renaming .md to .adoc
Hi @mklueh - your observations are correct:
After every update of the AsciiDoc plugin, the user will need to restart the IDE. There should be a small IDE prompt to do so. If it doesn't, this is a bug - please report it as such in this tracker.
When renaming a file to another extension, it needs to be re-opened. This is an IntelliJ thing.
If you want to convert a Markdown file to an AsciiDoc file, there's also an option in the context menu to convert the file form Markdown to AsciiDoc. It will also rename the file, and open it in the right editor. I tried this with a Markdown file which includes a Mermaid diagram - it is not perfect yet (one needs to change [source,mermaid]
to [mermaid]
), still it might speed up the process a bit.
Why the new feature should be added
Usability and security reasons
How the new feature should work
I'm wondering if it would be possible to make this plugin work as seamless as the official markdown plugin of IntelliJ when it comes to mermaid diagram rendering without the need of manual installation and configuration of tools.
https://github.com/JetBrains/intellij-community/tree/28ce2f43360fd1abcfe9ee39ce436578c0783a03/plugins/markdown/core/src/org/intellij/plugins/markdown/extensions/jcef/mermaid
I'm not exactly sure how they do it, but with the Markdown Plugin you don't have to have Node.js installed on your Windows machine and it kind of works out of the box. It seems they are using mermaid.js and do the rendering in a browser, rather than local.
For security reasons we can't install Node.js on our PC at work and have to go with WSL2 instead. However, this comes with other drawbacks, which is why we develop our Java applications on the local machine rather than in WSL2.
The options to display diagrams with ascidoc are now limited to Kroki, and running an extra server just to render some diagrams in the editor seems too overkill.
Would it be an option to copy what IntelliJ is doing to work exactly like there plugin does?