Skip to main content

sphinxcontrib-drawio-html

Sphinx Extension to add the drawio-html directive to include draw.io diagrams into the generated HTML documentation.

Important: This is an alpha extension and as such may not work or fit your needs 100%. See the KNOWN ISSUES SECTION.

Installation

  1. python3 -m pip install sphinxcontrib-drawio-html or use pipenv
  2. In your sphinx config:
extensions = [
    "sphinxdrawio.drawio_html"
]

Options

At this time no options in conf.py are supported.

Usage

.. drawio-html:: example.drawio
    :page: class-diagram
    :expanded:
    :hide-nav:
    :force-name:

    style-overrides

known issues

  1. This extension is tested using read-the-docs theme only. It uses jQuery and font-awesome that comes with rtd theme, and without the theme, it will not likely work.
  2. Only HTML translators are created, which means Latex and PDF support will not likely work. PDF and other builders are not tried at all.
  3. Custom styleoverrides are working intermittently. Some with HTML/CSS expertise might help in troubleshooting why not.

Wish list

  1. Provide defaults in the conf.py for expanded, hide-nav and force-name so that, a site can decide their basic way of showing the files. Currently it has to be done at each file.
  2. Change the content area to accept some rst per page in the draw.io diagram so that it can interspread easily with in the diagrams. Presentation can also be changed to show the diagrams and content for that section. Only option for now is the add multiple directives.
    .. drawio-html:: example.drawio
        :expanded:
        :hide-nav:
        :force-name:
    
        style-overrides
    
        class-diagram:
            lorum ipsum dorum
    
        sequence-diagram:
            nice orderly work.
    
    
  3. Add some tests. Do not even know how other sphinx extensions are tested.
  4. Full screen display of the diagrams.
  5. Provided notes can be added per diagram, provide a layout option to place notes on the right or bottom.

Do file issues if you see something, or better yet open a pull request :-)

ACKNOWLEDGEMENTS

  1. This is inspired by the work done by here: https://github.com/Modelmat/sphinxcontrib-drawio
  2. HTML/CSS experise is generously provided by https://github.com/BabyManisha

Release files for sphinxcontrib-drawio-html 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-drawio-html 0.1.2
File Size Uploaded
sphinxcontrib-drawio-html-0.1.2.tar.gz 6.3 kB Details

Release files / sphinxcontrib-drawio-html-0.1.2.tar.gz

Download URL sphinxcontrib-drawio-html-0.1.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
97f83ac50d983ed2a9850b270d7b052921769b857241c61d028c55bfc586282e
BLAKE2b-256 checksum
How to use checksums
798c0d9f482e4cd4173eaf0799382bc0d32d54e9e699ae0db195880b3c6da5c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page