I installed the sphinxcontrib-plantuml extension which works fine if I run the HTML builder e.g. with following testmodule.rst file for a corresponding testmodule.py file:
testmodule module
=================
.. automodule:: testmodule
:members:
:undoc-members:
:show-inheritance:
.. uml::
Alice -> Bob: Hi!
Alice <- Bob: How are you?
This adds the UML diagram at the very end of the document. Unfortunately I didn't find out how to embed a UML diagram anywhere in the documentation e.g. somewhere in the middle of a methods docstring block.
Does anyone know how to do that?
Adding the UML diagram directly in the docstring section didn't work for me. But following worked for me:
@startuml
Alice -> Bob: Hi!
Alice <- Bob: How are you?
@enduml
def example():
"""
some text
.. uml:: diagram.uml
some more text
"""
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With