Skip to main content

Documentation Generator for the CMake Language

Project description

https://codecov.io/gh/CMakePP/CMinx/branch/master/graph/badge.svg?token=wbiPq8Gnrs https://joss.theoj.org/papers/10.21105/joss.04680/status.svg

Full documentation can be found here.

Statement of Need

CMake build systems can be extended by writing CMake modules. CMake modules typically consist of one or more functions (or macros) written in the CMake language. In an effort to treat infrastructure as code, we need to be able to generate API documentation for these CMake modules. CMinx addresses this need by generating reStructuredText files from documented CMake modules. Since CMinx understands the grammar of the CMake language, these comments only need to focus on describing the code and not duplicating it.

Installation Instructions

The easiest way to install CMinx is via pip. Simply run:

pip install CMinx

CMinx can also easily be used as part of a CMake workflow by adding:

include(FetchContent)
FetchContent_Declare(
    cminx
    GIT_REPOSITORY https://github.com/cmakepp/cminx.git
)
FetchContent_MakeAvailable(cminx)
cminx_gen_rst("${input_dir}" "${output_dir}")

to your CMakeLists.txt file. More detailed instructions, can be found here.

Example Usage

To use CMinx, first document your CMake modules like:

#[[[
# A brief description.
#
# A more detailed description, must be separated from the brief by at least
# one blank line.
#
# :param param0: The 0-th parameter passed to the function
#]]
function(example param0)
    message("This function says: ${param0}")
endfunction()

The documentation resides in a normal CMake block comment aside from the fact that the block comment starts with an extra [ character. The body of the block comment is extracted into the reStructuredText file more or less verbatim so reStructuredText markup can be used within the comment for more formatting options. Assuming the above CMake module lives in example.cmake, the API documentation is generated by running:

foo@bar:~$ cminx example.cmake

Which will generate:

#######
example
#######

.. module:: example


.. function:: example(param0)

   A brief description.

   A more detailed description, must be separated from the brief by at least
   one blank line.

   :param param0: The 0-th parameter passed to the function

See here for more detailed usage instructions.

API Documentation

Full API documentation can be found here.

Contributing

In short, we try to be a welcoming community. If you have questions, suggestions, bug reports, etc. open an issue and we will address them as soon as possible. If you want to contribute code, that’s even better. We recommend you start a draft PR early in the process so we know the contribution is coming and can help you along the way.

CMinx is part of the CMakePP organization, whose contributing guidelines can be found here.

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

cminx-1.1.13.tar.gz (265.2 kB view details)

Uploaded Source

Built Distribution

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

cminx-1.1.13-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file cminx-1.1.13.tar.gz.

File metadata

  • Download URL: cminx-1.1.13.tar.gz
  • Upload date:
  • Size: 265.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cminx-1.1.13.tar.gz
Algorithm Hash digest
SHA256 16653b44efb453395bd4ac77ecc507a072d89570383795c7ff00ae018d6e7d90
MD5 a18d0f6f953d44740c3c57143b7097d8
BLAKE2b-256 6d82721d4732345dbde4e2d57b1a59c710da47af4293dc0de66e9bbde33b6a57

See more details on using hashes here.

File details

Details for the file cminx-1.1.13-py3-none-any.whl.

File metadata

  • Download URL: cminx-1.1.13-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cminx-1.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a045c0d3ceff46ec1402c6f4a80fdca0a1fb563c4ac648f8ce8c7cb545fbea7f
MD5 fc48c1739ee140e941bf6fa508ad77f8
BLAKE2b-256 eccd22ec9ebb6c00298a002e087213c782c3ad86d5991254a150359fa69c4734

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