Skip to main content

🧪 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'

Release files for ansible-pygments 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansible-pygments 0.1.2
File Size Uploaded
ansible_pygments-0.1.2.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ansible-pygments 0.1.2
File Interpreter ABI Platform
ansible_pygments-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / ansible_pygments-0.1.2.tar.gz

Download URL ansible_pygments-0.1.2.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a8c0c54c2f0237367b722f02941dfc52ecc850cb669b0e2ca842d0c0b8a7262d
BLAKE2b-256 checksum
How to use checksums
9951a4af927232a613ea20d52bfd465bf23b6a95d3a29611ab2fb78f1782e51f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2025.

Transparency log

Release files / ansible_pygments-0.1.2-py3-none-any.whl

Download URL ansible_pygments-0.1.2-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0be5c7a99c15ac3a28905052705e1eb9d0eec9a4f5135ca35c8547e983a82382
BLAKE2b-256 checksum
How to use checksums
d21036038f188023eac8a4f9fe3ca85bfb69b07690f34ed701d9bd1ad0f405bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page