Skip to main content

Ansible-Gendoc

Inspired by Felix Archambault's ansidoc project.

An example generated with ansible-gendoc.

Features

  • Generate the documentation for a role located in a directory
  • Can use a personal template README.j2 present in folder templates

Quickstart

If you have an existing README.md file in your role, backup it before !

Run From docker

Clone this project and build the image :

git clone
export DOCKER_BUILDKIT=1
docker build . -t ansible-gendoc:0.1.0 -t ansible-gendoc:latest
docker run --user $(id -u):$(id -g) -it ansible_gendoc:latest help

Install python package

Install the latest version Ansible-gendoc with pip or pipx

pip install ansible-gendoc

Usage

ansible-gendoc --help

 Usage: ansible-gendoc [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────╮
│ --version             -v        Show the application's version and exit.         │
│ --install-completion            Install completion for the current shell.        │
│ --show-completion               Show completion for the current shell, to copy   │
│                                 it or customize the installation.                │
│ --help                          Show this message and exit.                      │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────╮
│ init     Copy templates README.j2 from packages in templates/role folder.        │
│ render   Build the Documentation                                                 │
╰──────────────────────────────────────────────────────────────────────────────────╯

Build your first documentation of a role

To build the documentation roles, you can run these commands :

  • with package installed with pip ansible-gendoc render.
  • with docker images docker run --user $(id -u):$(id -g) -v <path_role>:/role -it ansible_gendoc:latest render role.

Use your personal template

To use a personal template, you need to init the template in the templates folder of your role. If ansible-gendoc find an existing file templates/README.j2, it will use it to render the README.md file.

ansible-gendoc init
ls templates
README.j2

The template use jinja as templating language.

Modify it, for example replace html or Restructuredtext or another language. You can remove some variables too.

Documentation of vars template

The documentation of vars coming soon.

Download files

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

Source Distribution

ansible-gendoc-0.1.8.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

ansible_gendoc-0.1.8-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file ansible-gendoc-0.1.8.tar.gz.

File metadata

  • Download URL: ansible-gendoc-0.1.8.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for ansible-gendoc-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b609487de7812b0153d71a7d50705e79681237b1d17b128975e9e025eea093a5
MD5 17fd8bbc80f93fc4220ceacf3d83b6f9
BLAKE2b-256 375b7b437584687911e8fa69df1c639d8ec614bd3cc4fae15c43e3869dc5864b

See more details on using hashes here.

File details

Details for the file ansible_gendoc-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: ansible_gendoc-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for ansible_gendoc-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a083243326db1f696474b33a31d37c3faad3eb97a6c1efd23019173367795263
MD5 db93ed5909b5d61c1041cfe9c8c476b1
BLAKE2b-256 9fa981b6540048043ee89551dc8355ae4bceafad118d97d0ba8e11d24b8a3928

See more details on using hashes here.

Supported by

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