Skip to main content

Tools for building the Ansible Distribution

Project description

Pygments lexer and style Ansible snippets

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.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

ansible_pygments-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ansible-pygments-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.15.12-arch1-1

File hashes

Hashes for ansible-pygments-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0d0a23cc562f94f4b464f931059ad1688635aac9642962bc68ae3acdb6efbcd0
MD5 34b94ea16fc530082f9fa45786468923
BLAKE2b-256 0b3553891104863a04f69ff761cccd9b11784e19793cd318ecff8f2e5c594401

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ansible_pygments-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.15.12-arch1-1

File hashes

Hashes for ansible_pygments-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85aa7412a46c83efcfe460c8016da289600c171d2edfa0f474e0dc30a398b002
MD5 575512ca618f836d099bba80e1449c53
BLAKE2b-256 5c8ad053d64b37b5b3859b5a883afec0ec4a41bfbc5d623a8efb5d343d99612d

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