Skip to main content

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-spec.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 spec file with a compatible format to the Ansible roles spec files is provided.

The format of the ansible spec files for 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

With no virtual Python environment active:

$ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansible_doc_template_extractor-0.6.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

ansible_doc_template_extractor-0.6.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file ansible_doc_template_extractor-0.6.0.tar.gz.

File metadata

File hashes

Hashes for ansible_doc_template_extractor-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b093374ad3f428b29a91e4c34ca5bab68724a3e21284b3d0e2c8099078343f75
MD5 e463a59dfa45019f1d9e81918b8452b1
BLAKE2b-256 4aea2a9eb7b28f466c6c781bad960909ffd7586ac33883632b3a2ee0c3f7c9d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_doc_template_extractor-0.6.0.tar.gz:

Publisher: publish.yml on andy-maier/ansible-doc-template-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansible_doc_template_extractor-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_doc_template_extractor-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2200c60b0523a2902510f54f44acee1faf02ade989cbc0abc2a29f4879330e2
MD5 a18f37a6a1fc7bced424669857fa450c
BLAKE2b-256 0ef0afbd0000d62cf51c82e561abb52437cd4985537e5e751a6b5a5067dc1c3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_doc_template_extractor-0.6.0-py3-none-any.whl:

Publisher: publish.yml on andy-maier/ansible-doc-template-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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