Skip to content

Conversation

@Anteru
Copy link
Collaborator

@Anteru Anteru commented Jun 8, 2023

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.

This would allow #2442 to use this machinery instead of embedding the snippets as "plain code" into the doc string.

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.
@Anteru Anteru requested a review from jeanas June 8, 2023 16:18
Also tweak the style a bit so code snippets in admonitions look
acceptable.
@Anteru Anteru merged commit 644da24 into master Jun 10, 2023
@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
@Anteru Anteru added this to the 2.16.0 milestone Jun 10, 2023
@Anteru Anteru self-assigned this Jun 10, 2023
@birkenfeld
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs area: changes to documentation/docstrings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants