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). - autoyaml_level(
1
) Parse comments from nested mappings n-levels deep.
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 318fc57230b4daecd6cb74bb1f1624a51951bc7478a14fdab19a0442a8f41cbe |
|
MD5 | 0da79699360481b76c2930bc31a6236c |
|
BLAKE2b-256 | 9f2910a99e970bbb7524077feb36c30efc79bfc242c3dd2647a515438a803c39 |
Close
Hashes for sphinxcontrib_autoyaml-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd4ef6f4411a34abd956113588e7a3d79b66f48f19a3349e3a20b0f21fdc9a7d |
|
MD5 | 289a30f7b05a807ad92faeece84678c2 |
|
BLAKE2b-256 | e48753122e3435d68e85d6d362e1bf7ce17e38a3edbeebb369d41db471d58aca |