Skip to main content

an extension for sphinx to render plantuml in sphinx documents

Project description

sphinx-plantuml

sphinx-plantuml Documentation Status pytest mypy flake8 pytest

introduction

sphinx-plantuml can render PlantUML figure in your Sphinx document without any dependencies in an instant

installation

you can install sphinx-plantuml by pip.

python3 -m pip install sphinx-plantuml

setup

please add sphinxcontrib.plantuml into your conf.py file.

extensions = [
    'sphinxcontrib.plantuml',
]

usage

you can use the following code to insert a figure into your document.

.. plantuml::

    @startuml
    Alice -> Bob: test
    @enduml

sphinx-plantuml renders the figure in .svg format, if you want .png format, you can use :format: argument.

.. plantuml::
    :format: png

    @startuml
    Alice -> Bob: test
    @enduml

if you want add a caption, you can use :caption: argument.

.. plantuml::
    :caption: this is caption

    @startuml
    Alice -> Bob: test
    @enduml

sphinx-plantuml directive can load PlantUML code from file.

.. plantuml:: /the/path/of/file.uml
    :caption: this is caption

sphinx-plantuml directive supports almost all arguments of sphinx builtin figure directive. for example, you can use :align: argument to control the layout of the figure.

.. plantuml:: /the/path/of/file.uml
    :caption: this is caption
    :align: center

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-plantuml-1.0.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

sphinx_plantuml-1.0.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page