PEP 1, 12: Update to reflect guidance for correct syntax highlighting #2445
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Presently, PEP 12 doesn't mention how to ensure that the automatic syntax highlighting added in the new Sphinx/PEP 676 build system gives the intended rendered output. Therefore, this PR adds a passage to the Literal Blocks section mentioning when and how to do this for specific blocks or entire PEPs. In the process, it also updates and simplifies the existing text.
Additionally, it updates PEP 1 and PEP 12 to follow those practices themselves, so they render as intended and serve as a good example for PEP authors. A future PR will fix the other existing PEPs where the default
python
syntax highlighting is not giving the rendered result the original author intended, to proactively solve existing issues like #2430 ; in most cases, it can be accomplished merely by adding a single.. highlight:: language
to the top of the PEP.