skillfed

sphinxcontrib-drawio

Sphinx Extension to include draw.io files

sphinxcontrib-drawio v0.0.17 87.5K downloads/30d#13,795 on PyPI42
Permissive license MIT Active released

What it is and what it does

sphinxcontrib-drawio is a Sphinx extension that lets you include draw.io diagrams directly in your documentation source. Instead of manually exporting diagrams to PNG or SVG and committing static images, you reference .drawio files in your reStructuredText using the drawio-image or drawio-figure directives, and the extension automatically exports them to your chosen format during the Sphinx build. It wraps the draw.io CLI tool and handles the mechanics of invoking it with the right options.

The extension is designed for projects that maintain diagrams in draw.io's native format and want those diagrams to stay in version control alongside the documentation source. It supports per-diagram export settings (format, scale, transparency, page selection) and builder-specific defaults, so you can export to SVG for HTML builds and PDF for LaTeX builds without duplicating directives. The main constraint is that it requires the draw.io desktop binary to be installed on the build machine, and on headless systems (CI, Docker) you need to configure virtual framebuffer support.

Use it for:

  • Maintain architecture diagrams, flowcharts, and UX mockups in draw.io and auto-export them to your Sphinx HTML/PDF documentation on each build.
  • Configure different export formats per Sphinx builder (SVG for web, PDF for print) without editing source files.
  • Scale diagrams to higher resolution for print output using the export-scale option.
  • Include multi-page draw.io files and select specific pages by index or name for different sections of your docs.
  • Run diagram export in CI/CD pipelines with headless mode and Xvfb for automated documentation builds.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Sphinx extension that embeds draw.io diagrams into documentation by converting .drawio files to image formats (PNG, JPG, SVG, PDF) during the build process.

Yes, if you actively maintain diagrams in draw.io and want them version-controlled and auto-exported in your Sphinx docs. The extension is stable, actively maintained, has no security issues, and low install friction. The main gotcha is the external draw.io binary dependency and headless-mode setup on CI—plan for that upfront. Not suitable for Read the Docs hosting.

Install

sphinxcontrib-drawio on PyPI

pip

pip install sphinxcontrib-drawio

uv

uv add sphinxcontrib-drawio

poetry

poetry add sphinxcontrib-drawio

Installing sphinxcontrib-drawio

Before you install

Low friction: pure Python wheel with only sphinx as a runtime dependency. Active maintenance (last commit 2026-04-13) with no recent security issues. Requires the draw.io desktop binary in PATH and Xvfb on headless systems, which are external system dependencies, not Python-level friction.

License in practice

MIT license (permissive) means you can use, modify, and distribute this extension freely in both open and closed projects with minimal restrictions.

Quickstart

pip install sphinxcontrib-drawio

# In conf.py:
extensions = ["sphinxcontrib.drawio"]

# In your .rst file:
.. drawio-image:: example.drawio
   :export-scale: 150

The draw.io desktop binary must be installed and accessible in $PATH (or configured via drawio_binary_path). On headless/CI systems, Xvfb must be installed and drawio_headless set to 'auto' or True. Does not work on Read the Docs due to RTD's restrictions on external packages.

Verify before relying

  • Whether the extension handles multi-page .drawio files reliably when page-index or page-name options are used.
  • Performance impact when exporting many large diagrams in a single documentation build.
  • Compatibility with recent versions of draw.io desktop (last release was 2023-09-12).

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 1 — sphinx
Maintenance actively maintained — 1,067 days since the last release
Last repo commit
First released
Downloads 87,467/month — #13,795 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sphinxcontrib_drawio-0.0.17-py3-none-any.whl

Framework :: Sphinx :: ExtensionLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

sphinx drawio diagram extensionembed draw.io files in sphinx docsconvert drawio to image sphinxsphinx diagram directivesdrawio export to documentationsphinx visual diagram plugin
sphinx-extensiondiagram-automationdocumentation-tooling

More Sphinx packages

docstring-parser

Parses Python docstrings in ReST, Google,…

permissive · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

sphinxcontrib-qthelp

A Sphinx extension that converts documentation…

permissive · top 1,000 on PyPI

mkdocs-drawio

A MkDocs plugin that embeds interactive Drawio…

permissive · top 15,000 on PyPI

sphinxcontrib-svg2pdfconverter

Converts SVG images to PDF or PNG for Sphinx…

permissive · top 15,000 on PyPI

sphinxcontrib-blockdiag

A Sphinx extension that embeds block diagrams…

permissive · top 15,000 on PyPI

sphinxcontrib-video

A Sphinx extension that embeds HTML5 videos…

permissive · top 15,000 on PyPI

sphinxcontrib-plantuml

Adds PlantUML diagram rendering to Sphinx…

permissive · top 15,000 on PyPI

sphinxcontrib-mermaid

Embeds Mermaid diagrams (flowcharts, sequence…

permissive · top 5,000 on PyPI

sphinxcontrib-programoutput

A Sphinx extension that executes arbitrary…

permissive · top 15,000 on PyPI

sphinx-substitution-extensions

Adds substitution support to Sphinx directives,…

permissive · top 15,000 on PyPI

swagger-plugin-for-sphinx

A Sphinx plugin that embeds interactive Swagger…

permissive · top 5,000 on PyPI

sphinxcontrib-youtube

Adds Sphinx directives to embed YouTube, Vimeo,…

permissive · top 15,000 on PyPI