Skip to content

Add a Sphinx extension to highlight custom keywords - #5084

Open
ZeroIntensity wants to merge 1 commit into
python:mainfrom
ZeroIntensity:highlighting
Open

Add a Sphinx extension to highlight custom keywords#5084
ZeroIntensity wants to merge 1 commit into
python:mainfrom
ZeroIntensity:highlighting

Conversation

@ZeroIntensity

Copy link
Copy Markdown
Member

Follow-up to #5077.

In PEPs that change syntax, new keywords aren't highlighted as such in code blocks. This makes examples look very foreign, which arguably affects the reception of the PEP.

As a solution, this PR introduces a Sphinx extension that adds special code blocks that allow adding new keywords. For example:

.. code-block:: python+soft-keywords:new_keyword,other_new_keyword

    use the new keyword(s) here

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #33951506 | 📁 Comparing 171126e against latest (87d12a9)

  🔍 Preview build  

1 file changed
± pep-0842/index.html

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant