Skip to main content

Integrate your doxygen-generated technical documentation into Sphinx

Project description

Docleaf

Your technical docs, beautifully integrated

Docleaf smoothly integrates your technical and long-form documentation. It is a Sphinx extension which reads Doxygen XML output and formats the information seamlessly with your user documentation.

License

Docleaf is licensed under the Parity Public License. The Parity license allows permissive use of Docleaf to help document open source projects. If you have a closed source project that you would like to document with Docleaf then you must purchase a commercial license. Please see the Docleaf Pricing page for more information.

If you have any questions please email: support@docleaf.io

Features

  • Custom directives allowing you to target various parts of C and C++ code bases.
  • Integration with Sphinx C and C++ domains to support easily linking to your generated output.
  • Hash-based content checks, as well as timestamp checks, to minimize incremental build times after a Doxygen run.
  • Integration with the sphinx.ext.linkcode extension to support links to source code locations in a GitHub repository.

Installation

Docleaf can be installed from PyPI:

pip install docleaf

Usage

Include docleaf.doxygen as an extension in your Sphinx conf.py file:

extensions = ["docleaf.doxygen"]

Configure the extension to know where your source code is stored and the Doxygen XML output has been generated for your project. Optionally set the default project:

docleaf_projects = {
  "my_project": {
    "root": "../src",
    "xml": "../doxygen/xml"
  }

}
docleaf_default_project = "my_project"

The use the provided directives in your reStructuredText files:

.. doxygenstruct:: ExampleStruct

See below for available directives.

Directives

Generate documentation for a C++ class.

.. doxygenclass:: ClassName

Generate documentation for a C or C++ struct.

.. doxygenstruct:: StructName

Generate documentation for a C or C++ function.

.. doxygenfunction:: function_name

Generate documentation for a C or C++ enum.

.. doxygenenum:: EnumName

Generate documentation for specific group as specified within your Doxygen set up and code comments.

.. doxygengroup:: group_name

All directives take a :project: option to specify the project to use from your conf.py if you don't want to use the default project.

Settings

  • docleaf_projects

    A Python dictionary mapping each project name to the folders where its source code and Doxygen XML output are stored.

  • docleaf_default_project

    The default project to use when none is specified on the directive itself.

  • docleaf_domain_by_extension

    A Python dictionary mapping from file extension to Sphinx domain. Docleaf uses Doxygen's language classifications where possible but for optimal control of how source files are classified it is useful to use this setting. For example:

    docleaf_domain_by_extension = {"hpp": "cpp", "h": "c"}
    

    Will make sure that all files that end in .hpp will be considered as C++ files and processed using the C++ Sphinx domain whilst files that end in .h will be considered C files and processed with the C Sphinx domain.

  • docleaf_doxygen_skip

    A list of instructions describing any parts of the Doxygen XML to skip when generating the output documentation. Supported entries are:

    • members:all_caps - Skips any function or variable members (as defined as a 'memberdef' by Doxygen) which have names which are all capital letters and underscores. This is to allow users to filter our unprocessed C/C++ macros if desirable.
    • xml-nodes:<node name> - Skips reading and process of the given XML node and its children in the Doxygen XML output. Support is limited to the htmlonly node.

Integration with sphinx.ext.linkcode

Docleaf can integrate with the sphinx.ext.linkcode extension in order to add [source] links next to various supported entries in your documentation. Linking to GitHub based repositories is supported.

In order to use it, add the sphinx.ext.linkcode extension to the extensions list in your Sphinx conf.py and use the docleaf.doxygen.GitHubLinkResolver with appropriate parameters for your repository.

extensions = [
  "docleaf.doxygen",
  "sphinx.ext.linkcode",
  ]

linkcode_resolve = docleaf.doxygen.GitHubLinkResolver(
    root="../../../", user="docleaf-labs", repo="docleaf", branch="main"
)

Where:

  • root is the relative path to the root of your repository.
  • user is the user or organisation name for your GitHub repository.
  • repo is the name of your GitHub repository.
  • tag is the git tag that you would like the generated link URLs to target.
  • branch is the git branch that you would like the generated link URLs to target.
  • commit is the git commit SHA that you would like the generated link URLs to target.

Only one of tag, branch and commit is necessary.

Performance

When doing a clean build of the Zephyr RTOS documentation suite, Docleaf is 2.1x faster than Breathe.

Benchmark: docleaf
  Time (mean ± σ):     180.383 s ±  3.213 s    [User: 448.242 s, System: 12.908 s]
  Range (min … max):   175.695 s … 185.187 s    10 runs
Benchmark: breathe
  Time (mean ± σ):     389.658 s ±  5.271 s    [User: 1839.366 s, System: 24.895 s]
  Range (min … max):   379.093 s … 394.315 s    10 runs

History

Docleaf is written and maintained by the creator of the Breathe project. It was created to resolve some of the performance and memory consumption issues with Breathe by rewriting the code base to use Rust. The user experience is designed to match and improve on Breathe.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

docleaf-0.8.3-cp311-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

docleaf-0.8.3-cp311-none-win32.whl (1.0 MB view hashes)

Uploaded CPython 3.11 Windows x86

docleaf-0.8.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

docleaf-0.8.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

docleaf-0.8.3-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

docleaf-0.8.3-cp311-cp311-macosx_10_7_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

docleaf-0.8.3-cp310-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

docleaf-0.8.3-cp310-none-win32.whl (1.0 MB view hashes)

Uploaded CPython 3.10 Windows x86

docleaf-0.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

docleaf-0.8.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

docleaf-0.8.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

docleaf-0.8.3-cp310-cp310-macosx_10_7_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

docleaf-0.8.3-cp39-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

docleaf-0.8.3-cp39-none-win32.whl (1.0 MB view hashes)

Uploaded CPython 3.9 Windows x86

docleaf-0.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

docleaf-0.8.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

docleaf-0.8.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

docleaf-0.8.3-cp39-cp39-macosx_10_7_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

docleaf-0.8.3-cp38-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

docleaf-0.8.3-cp38-none-win32.whl (1.0 MB view hashes)

Uploaded CPython 3.8 Windows x86

docleaf-0.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

docleaf-0.8.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

docleaf-0.8.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

docleaf-0.8.3-cp38-cp38-macosx_10_7_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

docleaf-0.8.3-cp37-none-win_amd64.whl (1.1 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

docleaf-0.8.3-cp37-none-win32.whl (1.0 MB view hashes)

Uploaded CPython 3.7 Windows x86

docleaf-0.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

docleaf-0.8.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ i686

docleaf-0.8.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

docleaf-0.8.3-cp37-cp37m-macosx_10_7_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

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