Skip to main content

Tools for building the Ansible Distribution

Project description

Pygments lexer and style Ansible snippets

Python linting badge GitHub Actions CI/CD workflow Codecov badge

This project provides a Pygments lexer that is able to handle Ansible output. It may be used anywhere Pygments is integrated. The lexer is registered globally under the name ansible-output.

It also provides a Pygments style for tools needing to highlight code snippets.

The code is licensed under the terms of the BSD 2-Clause license.

Using the lexer in Sphinx

Make sure this library in installed in the same env as your Sphinx automation via pip install ansible-pygments sphinx. Then, you should be able to use a lexer by its name ansible-output in the code blocks of your RST documents. For example:

.. code-block:: ansible-output

    [WARNING]: Unable to find '/nosuchfile' in expected paths (use -vvvvv to see paths)

    ok: [localhost] => {
        "msg": ""
    }

Using the style in Sphinx

It is possible to just set ansible in conf.py and it will "just work", provided that this project is installed alongside Sphinx as shown above.

pygments_style = 'ansible'

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-pygments-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

ansible_pygments-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file ansible-pygments-0.1.0.tar.gz.

File metadata

  • Download URL: ansible-pygments-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for ansible-pygments-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c106912afcb0115444f79152687731436b30b69bf230f09a0b1127bd7a9b9ef
MD5 f085af9e73fece415b444f68c1c42b74
BLAKE2b-256 af0707143d693d02d23ed4b04af0b9444996a8773c15015de2cfcf1778f3dcd2

See more details on using hashes here.

File details

Details for the file ansible_pygments-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ansible_pygments-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for ansible_pygments-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 055a46de4b745b1090fc596aba15c9324fe346a7b048955995b5337393e541f9
MD5 aa3a2e1fca5cfba6258144c87b35b3d9
BLAKE2b-256 84808727993f40324a110b63926fdafb4a5f0210e37aed5d48e6ff44ddbd0663

See more details on using hashes here.

Supported by

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