The py-capellambse Sphinx extension

Sphinx extension for capellambse.

This extension is be used to display diagrams in Sphinx-generated documentation.

Usage

To render a diagram in your documentation, simply define a diagram directive.

.. diagram:: [CDB] BaseLayer ORM
    :alt: Base layer diagram
    :height: 480
    :width: 640
    :align: center -- can be left/right/center

The options are optional.

Configuration

To enable this extension, add it to your list of extensions in Sphinx’ conf.py.

# conf.py

extensions = [
    ...,
    'capellambse.sphinx',
]

The following configuration variables are understood by this extension:

  • capellambse_model: Path to the Capella model.

    Set this variable to the root .aird file of the model you want to use in the documentation. The path must be relative to Sphinx’ current working directory, which should be the directory containing the conf.py file.

Known limitations

  • The extension currently does not detect changes to the model, nor does it track which source files are using it. This means that, after changing the model, you need to force a full rebuild of all pages by passing --fresh-env to Sphinx’ build command.