skillfed

ansible-pygments

Tools for building the Ansible Distribution

ansible-pygments v0.1.2 159.9K downloads/30d#10,682 on PyPI6
Permissive license BSD-2-Clause Active released

What it is and what it does

ansible-pygments is a Pygments plugin that adds syntax highlighting support for Ansible command output and a matching color scheme. It registers a lexer named `ansible-output` that recognizes Ansible's structured output format and applies semantic coloring. The package is designed to integrate with any tool that uses Pygments for code highlighting.

You install it alongside pygments, then reference the `ansible-output` lexer by name in code blocks or use the `ansible` style in configuration. It depends only on pygments and supports Python 3.9 through 3.13.

Use it for:

  • Highlight Ansible playbook output examples in documentation with semantic color coding.
  • Format Ansible command logs in technical runbooks for better readability.
  • Style Ansible output in code snippets embedded in web pages or markdown rendered by pygments.
  • Improve visibility of Ansible warnings and errors in generated operations documentation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Pygments lexer and style for syntax-highlighting Ansible output, registered globally as `ansible-output` for use in any tool that integrates Pygments.

Yes, if you use pygments-based tools to document or display Ansible output. It is actively maintained, has no security issues, and adds a single lightweight dependency. Not necessary if you do not use Pygments-integrated documentation or do not need Ansible-specific highlighting.

Install

ansible-pygments on PyPI

pip

pip install ansible-pygments

uv

uv add ansible-pygments

poetry

poetry add ansible-pygments

Installing ansible-pygments

Before you install

Low install friction with a single runtime dependency on pygments. Actively maintained with recent commits and no known vulnerabilities.

License in practice

BSD-2-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install ansible-pygments pygments

import pygments
from pygments.lexers import get_lexer_by_name
lexer = get_lexer_by_name('ansible-output')

Requires Python 3.9 or later.

Verify before relying

  • Whether the lexer handles all Ansible output formats (warnings, errors, variable dumps) beyond documented examples.
  • Performance characteristics when highlighting large Ansible logs or output blocks.
  • Full integration steps with documentation tools beyond the description excerpt provided.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.9.0)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pygments
Maintenance actively maintained — 405 days since the last release
Last repo commit
First released
Downloads 159,912/month — #10,682 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ansible_pygments-0.1.2-py3-none-any.whl

Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

ansible output syntax highlightingpygments lexer ansibleansible code block formattinghighlight ansible playbook outputansible syntax coloringpygments ansible styleansible output lexer
ansiblesyntax-highlighting

More Documentation packages

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

griffe

Griffe extracts the complete structure and…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

ipython-pygments-lexers

Provides Pygments syntax highlighters for…

permissive · top 1,000 on PyPI

pygments-styles

Provides a curated collection of Pygments…

permissive · top 15,000 on PyPI

Pygments

Pygments is a syntax highlighter that colorizes…

permissive · top 100 on PyPI

fluent.pygments

Adds syntax highlighting support for Fluent…

permissive · top 15,000 on PyPI

accessible-pygments

Provides a collection of WCAG 2.1-compliant…

permissive · top 5,000 on PyPI

antsibull-docs

Builds and generates Ansible documentation from…

copyleft · top 15,000 on PyPI

rich-argparse

Formats argparse and optparse help output with…

permissive · top 1,000 on PyPI

jupyterlab-pygments

Provides a Pygments syntax highlighting theme…

permissive · top 1,000 on PyPI

antsibull-docs-parser

A Python library for parsing and processing…

copyleft · top 15,000 on PyPI

pygmars

Pygmars builds lightweight lexers and parsers…

permissive · top 15,000 on PyPI