Add support for lexer examples. by Anteru · Pull Request #2451 · pygments/pygments

@Anteru

This adds support for a new attribute `_example` which, if present, will
load the file under `tests/examplefiles` pointed to by `_example` and
show it as part of the lexer documentation. This allows us to have
unit-tested files show up as small code snippets in the documentation,
without having to worry that the documentation output contains possibly
incorrectly highlighted code.

jeanas

@Anteru

Also tweak the style a bit so code snippets in admonitions look
acceptable.

@Anteru Anteru deleted the anteru/lexer-examples branch

June 10, 2023 10:16

@Anteru Anteru added the A-docs

area: changes to documentation/docstrings

label

Jun 10, 2023