Skip to main content

Hawkmoth - Sphinx Autodoc for C

Project description

GitHub tag (latest SemVer) BSD-2-Clause Read the Docs PyPI Downloads

Hawkmoth - Sphinx Autodoc for C

Hawkmoth is a minimalistic Sphinx C and C++ Domain autodoc directive extension to incorporate formatted C and C++ source code comments written in reStructuredText into Sphinx based documentation. It uses Clang Python Bindings for parsing, and generates C and C++ Domain directives for C and C++ API documentation, and more. In short, Hawkmoth is Sphinx Autodoc for C/C++.

Hawkmoth aims to be a compelling alternative for documenting C and C++ projects using Sphinx, mainly through its simplicity of design, implementation and use.

Example

Given C source code with rather familiar looking documentation comments:

/**
 * Get foo out of bar.
 */
void foobar();

and a directive in the Sphinx project:

.. c:autodoc:: filename.c

you can incorporate code documentation into Sphinx. It’s as simple as that.

You can document functions, their parameters and return values, structs, unions, their members, macros, function-like macros, enums, enumeration constants, typedefs, variables, as well as have generic documentation comments not attached to any symbols.

Documentation

Documentation on how to install and configure Hawkmoth, and write documentation comments, with examples, is available in the doc directory in the source tree, obviously in Sphinx format and using the directive extension. Pre-built documentation showcasing what Hawkmoth can do is available at Read the Docs.

Installation

You can install Hawkmoth from PyPI with:

pip install hawkmoth

You’ll additionally need to install Clang and Python 3 bindings for it through your distro’s package manager; they are not available via PyPI. For further details, see the documentation.

Alternatively, installation packages are available for:

There are also Docker images jnikula/hawkmoth and jnikula/hawkmoth-latexpdf at Docker Hub.

In Sphinx conf.py, add hawkmoth to extensions, and point cautodoc_root at the source tree. See the extension documentation for details.

Development and Contributing

Hawkmoth source code is available on GitHub. The development version can be checked out via git using this command:

git clone https://github.com/jnikula/hawkmoth.git

Please file bugs and feature requests as GitHub issues. Contributions are welcome both as GitHub pull requests (preferred) and as emailed patches to the mailing list.

See CONTRIBUTING.rst for more details.

Dependencies

Dependencies and their minimum versions:

  • Python 3.6

  • Sphinx 3

  • Clang library 6

  • Python 3 Bindings for Clang library 6

There are additional development and testing dependencies recorded in setup.cfg.

License

Hawkmoth is free software, released under the 2-Clause BSD License.

Contact

IRC channel #hawkmoth on OFTC IRC network.

Mailing list hawkmoth@freelists.org. Subscription information at the list home page.

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

hawkmoth-0.13.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

hawkmoth-0.13.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file hawkmoth-0.13.0.tar.gz.

File metadata

  • Download URL: hawkmoth-0.13.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for hawkmoth-0.13.0.tar.gz
Algorithm Hash digest
SHA256 a4f05a5b080b0389d66de6f3e061a71b036440f140e7b47984064ff5b7e16f31
MD5 e1f920b9c25c6ab5d76168e1087b4935
BLAKE2b-256 2cbb4556f72ae0d1b472c59387556a2770e8cbaeb298019b03483ad3be136b9c

See more details on using hashes here.

File details

Details for the file hawkmoth-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: hawkmoth-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for hawkmoth-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7028596897524ea02256abbb23ec2bf059055766189828cd013672cd00f67360
MD5 4d55ab294979bc069ef6a660edb467d9
BLAKE2b-256 e164ecd53062a27630eaeadaa29338537d9619e6274b98bc874c43c2b01b6766

See more details on using hashes here.

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