Sphinx autodoc extension for documenting YAML files from comments
Project description
sphinxcontrib-autoyaml
This Sphinx autodoc extension documents YAML files from comments. Documentation is returned as reST definitions, e.g.:
This document:
###
# Enable Nginx web server.
enable_nginx: true
###
# Enable Varnish caching proxy.
enable_varnish: true
would be turned into text:
enable_nginx
Enable Nginx web server.
enable_varnish
Enable Varnish caching proxy.
See tests/examples/output/index.yml
and tests/examples/output/index.txt
for
more examples.
autoyaml
will take into account only comments which first line starts with
autoyaml_doc_delimiter
.
Usage
You can use autoyaml
directive, where you want to extract comments
from YAML file, e.g.:
Some title
==========
Documenting single YAML file.
.. autoyaml:: some_yml_file.yml
Options
Options available to use in your configuration:
- autoyaml_root(
..
) Look for YAML files relatively to this directory. - autoyaml_doc_delimiter(
###
) Character(s) which start a documentation comment. - autoyaml_comment(
#
) Comment start character(s).
Installing
Issue command:
pip install sphinxcontrib-autoyaml
And add extension in your project's conf.py
:
extensions = ["sphinxcontrib.autoyaml"]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sphinxcontrib-autoyaml-0.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 843b2b17311807cc572dc4ca037acd10462b7675cc4d3beb8e153f5fd86c0477 |
|
MD5 | f1584ae9cff7d36d527269c1307666ed |
|
BLAKE2b-256 | 09bd82bb27efcbd221876ab85b0a33db6b477eead669b5faaa111fd4677bc86d |
Close
Hashes for sphinxcontrib_autoyaml-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fefd644cd4f306b9232ff6a6269b012a138a8d6cb22fc36d826f72fd552216ae |
|
MD5 | 0ae912430ed63b45e74e10fb3e0975af |
|
BLAKE2b-256 | 8f8e88fa5d7342291f4dc43cd8dd6927e5aa6f54388414c9fd9a4e4285930b81 |