markvincze / sabledocs

Simple static documentation generator for Protobuf and gRPC contracts.
MIT License
43 stars 11 forks source link

embedding plantUML diagrams #55

Open abdelhalim opened 2 months ago

abdelhalim commented 2 months ago

Is there a way to embed plantUML diagrams in the comments ?

yinzara commented 2 months ago

You could use the protoc-gen-uml protobuf plugin to generate the UML into the static directory then link to it from your main content page.

markvincze commented 2 months ago

@abdelhalim Not at the moment. I'm not very familiar with PlantUML, do I see it correctly that the way to generate the diagram images from the markup is to use the CLI which depends on Java? I see that there is an extension for python-markdown which gives PlantUML support: https://pypi.org/project/plantuml-markdown/, but this also requires the PlantUML binary and Java to be installed as far as I see. I could imagine this being supported as an optional extension, but I'd need to look into it in more detail, which I'm not sure when I could get to.

In the meantime, the solution you can use is what yinzara advised, to generate the UML diagrams outside of sabledocs, and put the generated images in static. Although I don't know if you'll be able to embed images in the comments, I've only tested that on the main page content.