Skip to main content

Tools for building the Ansible Distribution

Project description

🧪 GitHub Actions CI/CD workflow tests badge pre-commit.ci status badge Codecov badge

Pygments lexer and style Ansible snippets

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ansible_pygments-0.1.2.tar.gz.

File metadata

  • Download URL: ansible_pygments-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ansible_pygments-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a8c0c54c2f0237367b722f02941dfc52ecc850cb669b0e2ca842d0c0b8a7262d
MD5 29b5567388ae281882dcd37d81226a71
BLAKE2b-256 9951a4af927232a613ea20d52bfd465bf23b6a95d3a29611ab2fb78f1782e51f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_pygments-0.1.2.tar.gz:

Publisher: ci-cd.yml on ansible-community/ansible-pygments

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_pygments-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_pygments-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0be5c7a99c15ac3a28905052705e1eb9d0eec9a4f5135ca35c8547e983a82382
MD5 d290104a40e3bfea44292b6a65ed7f9e
BLAKE2b-256 d21036038f188023eac8a4f9fe3ca85bfb69b07690f34ed701d9bd1ad0f405bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_pygments-0.1.2-py3-none-any.whl:

Publisher: ci-cd.yml on ansible-community/ansible-pygments

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page