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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7be8cee5f2e1817b20007d20dad7ed0f3521c3ff57b7f77c0abff4224e6882c6 |
|
MD5 | a2a88da0ed7ba9391e8b475d0a5a6e99 |
|
BLAKE2b-256 | c03a95164bc33f92be64b6eb823417b70b669991647537140175764a1a07bbab |
Close
Hashes for sphinxcontrib_autoyaml-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c4be384e09ee9713bfdb976da3c36b7cc70685a54406d9874ac6f1f469eace |
|
MD5 | 8eea256cbfaa63907319832054e94017 |
|
BLAKE2b-256 | ab2a60cb10b06b1bab18a16e08305fb22035d775f2e08a7b465f990a763b6a26 |