Add support for PlantUML
Ukonn Ra
PlantUML is the best tool for UML and system design. GitLab has a great integration for it: https://docs.gitlab.com/ee/administration/integration/plantuml.html. Hoping Docusauraus can support it too.
Yes, we have alternative solution by writing a custom component, but:
- we cannot copy'n'paste existing Markdown files
- it does not support multi-line code very well
M
Marco Stroppel
I created this one: https://github.com/mstroppel/remark-local-plantuml/
If you do not want to spin up a kroki (or similar) server and you do not send your data to the PlantUML server.
v
viet Cuong
Marco Stroppel thank you for this repo. I also like that idea that not require data to be sent to plantUML server
Eric Chen (airkro)
Javier Jiménez Roda
Eric Chen (airkro): how shall this be used? I mean, after installing the npm pacakge, where shall I place the code? the contents of the github page are not very clear.
Eric Chen (airkro)
Javier Jiménez Roda: Add remark plugin to you docusaurus config, place you code as markdown code block
fortnum
Eric Chen (airkro): It's fine. But it doesn't work with Markdown Preview Enhanced VSCode extension. The extension requires "puml" fenced code identifier, but Kroki requires "kroki" identifier with meta type=plantuml. So, Kroki works in browser, but not in Markdown Preview Enhanced inside VSCode, and vice-versa. Would you recommend any another way or any solution to this problem?
UPD. I got it. I used alias options feature in remark-kroki. Instead of ```
kroki type=plantuml
we can type ```plantuml type=plantuml
, but we have to set additional option alias: ["plantuml"] for remark plugin in docusaurus.config.js. The plantuml fenced code identifier works as trigger for Markdown Preview Enhanced VSCode extension (it just ignores the type meta), and at the same time, thanks to alias, plantuml now triggers the kroki plugin. It's bad that this alias is inseparable from type meta in the remark-kroki plugin, they must necessarily match in order for it to work, that is, alias puml will not work, but in this case they match, due to the fact that Markdown Preview Enhanced reacts to both, puml and plantuml, fenced code identifiers.Eric Chen (airkro)
fortnum: Using ```
plantuml
is enoughDamien Remars
Would this do the trick? https://github.com/TeamDaugherty/docusaurus-plantuml