Ansible Documentation Template Extractor
Project description
ansible-doc-template-extractor
ansible-doc-template-extractor is a documentation extractor that supports
the format Ansible roles use in their meta/argument_specs.yml files as input,
and arbitrary Jinja2 template files to control what is generated as output.
It can also be used for Ansible playbooks, as long as a YAML argument spec file is provided. The format can differ from the argument spec files for roles, but of course the template file needs to match the format.
The format of the argument spec files for Ansible roles is described here: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#specification-format
Disclaimer: There have been discussions in Ansible forums to add support for Ansible roles to the ansible-doc and ansible-navigator tools. Once that happens, the ansible-doc-template-extractor tool is probably no longer needed. The ansible-doc-template-extractor tool should be seen as a temporary bridge until there is more official documentation extraction support provided.
Installation
If you want to install it into a virtual Python environment:
$ pip install ansible-doc-template-extractor
Otherwise, you can also install it without having a virtual Python environment:
-
If not yet available, install the "pipx" command as described in https://pipx.pypa.io/stable/installation/.
-
Then, install the package using "pipx":
$ pipx install ansible-doc-template-extractor
Example use
Suppose you have the following subtree:
├── my_collection
| ├── roles
| ├── my_role
| └── meta
| └── argument_specs.yml
├── templates
│ └── role.md.j2
├── docs
Then you can run the extractor as follows:
$ ansible-doc-template-extractor --template templates/role.md.j2 docs my_collection/roles/my_role/meta/argument_specs.yml
Loading template file: templates/role.md.j2
Ansible name: my_role
Loading spec file: my_collection/roles/my_role/meta/argument_specs.yml
Created output file: docs/my_role.md
and it will create an .md file with the documentation of the role:
├── docs
│ └── my_role.md
Example template files can be downloaded from https://github.com/andy-maier/ansible-doc-template-extractor/tree/master/examples/templates
Reporting issues
If you encounter a problem, please report it as an issue on GitHub.
License
This package is licensed under the Apache 2.0 License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ansible_doc_template_extractor-0.7.0.tar.gz.
File metadata
- Download URL: ansible_doc_template_extractor-0.7.0.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2f0e62841eaf9d3ab3c5b6ffa4136a6903820d86976ce2a684c84796d7745a4
|
|
| MD5 |
b1c5e8db747e7d22e5e65f2f7a85fe37
|
|
| BLAKE2b-256 |
8f99511b331e8b2e47233551c8649a7a9caa3752c0de70635c0afe52001fd2ed
|
Provenance
The following attestation bundles were made for ansible_doc_template_extractor-0.7.0.tar.gz:
Publisher:
publish.yml on andy-maier/ansible-doc-template-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ansible_doc_template_extractor-0.7.0.tar.gz -
Subject digest:
c2f0e62841eaf9d3ab3c5b6ffa4136a6903820d86976ce2a684c84796d7745a4 - Sigstore transparency entry: 657118649
- Sigstore integration time:
-
Permalink:
andy-maier/ansible-doc-template-extractor@602053cddab9c006260a47a2253c2d5e53c02eab -
Branch / Tag:
refs/tags/0.7.0 - Owner: https://github.com/andy-maier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@602053cddab9c006260a47a2253c2d5e53c02eab -
Trigger Event:
push
-
Statement type:
File details
Details for the file ansible_doc_template_extractor-0.7.0-py3-none-any.whl.
File metadata
- Download URL: ansible_doc_template_extractor-0.7.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95a625a5bf19a3b50d7fb12b84a05afbf0bf51999d9928a36da61ebd5f9b1b81
|
|
| MD5 |
38b7a200bdd351730066842783745899
|
|
| BLAKE2b-256 |
2712280ff7e335fe70bc36759cad21c7de1512299db5ecf334aec8b0fb2677d5
|
Provenance
The following attestation bundles were made for ansible_doc_template_extractor-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on andy-maier/ansible-doc-template-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ansible_doc_template_extractor-0.7.0-py3-none-any.whl -
Subject digest:
95a625a5bf19a3b50d7fb12b84a05afbf0bf51999d9928a36da61ebd5f9b1b81 - Sigstore transparency entry: 657118671
- Sigstore integration time:
-
Permalink:
andy-maier/ansible-doc-template-extractor@602053cddab9c006260a47a2253c2d5e53c02eab -
Branch / Tag:
refs/tags/0.7.0 - Owner: https://github.com/andy-maier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@602053cddab9c006260a47a2253c2d5e53c02eab -
Trigger Event:
push
-
Statement type: