Skip to main content

Tool to build documentation for C++/Python-Packages used at MPI-IS

Project description

Documentation Builder for C++ and Python packages

Breathing Cat is a tool for building documentation that is used for some of the software packages developed at the Max Planck Institute for Intelligent Systems (MPI-IS) and the New York University.

It is basically a wrapper around Doxygen, Sphinx and Breathe and runs those tools to generate a Sphinx-based documentation, automatically including API documentation for C++, Python and CMake code found in the package.

It is tailored to work with the structure of our packages but we are doing nothing extraordinary there, so it will likely work for others as well (see below for the assumptions we make regarding the package structure).

Installation

Breathing Cat depends on Doxygen for generating C++ documentation. As Doxygen cannot automatically be installed as dependency by pip, it needs to be installed manually. For example on Ubuntu:

sudo apt install doxygen

To install Breathing Cat with all further dependencies:

pip install breathing_cat

Usage

In the most simple case you can run it like this:

bcat --package-dir path/to/package --output-dir path/to/output

If no package version is specified, bcat tries to find it by checking a number of files in the package directory. If no version is found this way, it fails with an error. In this case, you can explicitly specify the version using --package-version.

bcat tries to automatically detect if the package contains Python code and, if yes, adds a Python API section to the documentation. However, if your package contains Python modules that are only generated at build-time (e.g. Python bindings for C++ code) you can use --python-dir to specify the directory where the Python modules are installed to. This way, the generated modules will be included in the documentation as well.

For a complete list of options see bcat --help.

Instead of the bcat executable, you can also use python -m breathing_cat.

Configuration

A package can contain an optional config file breathing_cat.toml which has to be placed either in the root directory of the package or in doc[s]/.

Below is an exemplary config file, including all available options with their default values:

[doxygen]
# List of patterns added to DOXYGEN_EXCLUDE_PATTERNS (see doxygen documentation).
# The string '${PACKAGE_DIR}' in the patterns is replaced with the path to the package.
# It is recommended to put this at the beginning of patterns to avoid unintended matches
# on higher up parts on the path, which would result in *all* the files of the package
# being excluded.
# Example:
# exclude_patterns = ["${PACKAGE_DIR}/include/some_third_party_lib/*"]
exclude_patterns = []


[intersphinx.mapping]
# Add intersphinx mappings.  See intersphinx documentation for the meaning of the
# values.
# Two notations are supported:
#
# 1. Long notation (results in `'foo': ('docs.foo.org', 'my_inv.txt'):
# foo = {target = "docs.foo.org", inventory = "my_inv.txt"}
#
# 2. # Short notation (results in `'foo': ('docs.foo.org', None):
# foo = "docs.foo.org"

Assumptions Regarding Package Structure

Breathing Cat makes the following assumptions regarding the structure of the documented package:

  • The directory containing the package has the same name as the actual package.

  • The package may contain a README file that has one of the following names (case insensitive): README, README.txt, README.md, README.rst

  • The package may contain a license file called LICENSE or license.txt.

  • C++ code is documented using Doxygen comments in the header files.

  • C++ header files are located outside of src/ (typically in include/).

  • Python code is documented using docstrings (supported formats are standard Sphinx, NumPy Style and Google Style).

  • The Python code is located in one of the following directories (relative to the package root):

    • <package_name>/
    • python/<package_name>/
    • src/<package_name>/
  • CMake files that should be documented are located in cmake/ and use the directives provided by the sphinxcontrib.moderncmakedomain extension.

  • General documentation is provided in reStructuredText- or Markdown-files located in doc/ or docs/. All files found in this directory are automatically included in alphabetical order.

Copyright & License

Copyright (c) 2022, New York University and Max Planck Gesellschaft.

License: BSD 3-clause (see LICENSE).

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

breathing_cat-1.0.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

breathing_cat-1.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file breathing_cat-1.0.0.tar.gz.

File metadata

  • Download URL: breathing_cat-1.0.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for breathing_cat-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f81cb2a0b6c1b5e1f403fd720f026db2e813897c1c8057b6c641ebd5ca4024e7
MD5 85784e9cf5acb40b5f68cfd16b9396e4
BLAKE2b-256 a17346594cf858e0c69a56a2a42fe8e6cf11f3473454ce4c78428fb95e5b0183

See more details on using hashes here.

File details

Details for the file breathing_cat-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: breathing_cat-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for breathing_cat-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d83796df488fd75d88650feb435648f3c441056e18af1d6e534279f26d00bcb1
MD5 58305d379daa587ed5f1621edaa0e22a
BLAKE2b-256 8064596ef6e79300a55d441b906de7daebd3f17535833bcc998c41d9cba81dc4

See more details on using hashes here.

Supported by

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