Skip to main content

Extract Ansible module documentation

Project description

This package contains code for Ansible collection documentation extractor. Its main audience are Ansible collection maintainers that would like to publish API docs in the HTML form without having to manually copy the data already present in the module’s metadata.

Quickstart

Documentation extractor is published on PyPI and we can install it using pip:

$ pip install ansible-doc-extractor

If the previous command did not fail, we are ready to start extracting the documentation:

$ ansible-doc-extractor \
    /tmp/output-folder \
    ~/.ansible/collections/ansible_collections/my/col/plugins/modules/*.py

This will extract the documentation from modules in my.col collection and place resulting rst files into /tmp/output-folder.

Custom template

ansible-doc-extractor supports a custom Jinja2 template file via --template. The following variables are sent to the template:

Variable name

Type

Description

Module’s documentation key

short_description

str

Short description of a module.

short_description

description

str / list

Longer description of a module, type depends on the module’s description type.

description

requirements

list

Requirements needed on the host that executes this module.

requirements

options

dict

All module options, often called parameters or arguments.

options

notes

list

Module’s additional notes.

notes

seealso

list

Details of any important information that doesn’t fit in one of the above sections.

seealso

deprecated

str

Marks modules that will be removed in future releases

deprecated

author

str / list

Author of the module, type can vary depending on how many authors module has.

author

metadata

dict

This section provides information about the module

Refers to ANSIBLE_METADATA block in the module.

examples

str

Code examples

Refers to EXAMPLES block in the module.

returndocs

dict

This section documents the information the module returns.

Refers to RETURN block in the module.

You can always refer to the default Jinja2 template.

Development setup

Getting development environment up and running is relatively simple if we have pipenv installed:

$ pipenv update

To test the extractor, we can run:

$ pipenv run ansible-doc-extractor

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-extractor-0.1.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

ansible_doc_extractor-0.1.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file ansible-doc-extractor-0.1.1.tar.gz.

File metadata

  • Download URL: ansible-doc-extractor-0.1.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for ansible-doc-extractor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 be14e4fa7b1f59c74674a080c2d1306cedddf6ce956c6218ceb4cc7f034d579d
MD5 b28d7fbb410d467783b988245ac6cda6
BLAKE2b-256 0bf562071dab5bf977d0b4aaadad18d4688ddba060c2863560390090e25a8e1d

See more details on using hashes here.

File details

Details for the file ansible_doc_extractor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ansible_doc_extractor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for ansible_doc_extractor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37400f69500fb7a70f00b1f362f7493ef8b776d3d98ba1b65103e286fa2c11aa
MD5 1dde3a722a76681c87242f834e815f6e
BLAKE2b-256 f6dd3f87aeda90e1a2f08f6e8412fed7b3777aee2598c5a49aa62e20178f823d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page