PlantUML Example
There is a plugin for sphinx called sphinxcontrib-plantuml which adds support for embedding plantuml
into .rst files so the generated HTML files will show beautiful UML diagrams.
One can achieve this by following these instructions:
Make sure
plantumlis properly installed on your machine/environment, for instance it can be installed viacondalike this:conda install -c conda-forge plantuml
Make sure you have the
sphinxplugin forplantuml(installable viapip)pip install sphinxcontrib-plantuml
Make sure that this plugin would be recognized in your
conf.pyby adding it to theextentionslistNote
In this project the
conf.pyis generated bycmakefrom theconf.py.infile and therefore this addition should be added toconf.py.insince it’s the template file for the generatedconf.py.extentions = [ ... "sphinxcontrib.plantuml", ... ]
After those instructions you should be able to add the following directives in your .rst files
.. uml::
@startuml
skinparam monochrome true
Alpha -> Bravo
Bravo -> Alpha
@enduml
Or if you prefer:
.. plantuml::
@startuml
skinparam monochrome true
Alpha -> Bravo
Bravo -> Alpha
@enduml
Here is how it looks (this is a very small sequence diagram)
Here is a far more complex class diagram :