| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Sorry about this, but I just realized that in the next Sphinx release, we might need to include pycon3 language as well (ref: sphinx-doc/sphinx#5770). |
Sorry, something went wrong.
|
On the contrary, you're finding an issue before it happen, I think this is great ^^ |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Many code examples on the official Python documentation do not have a >>> copy button. For example, the code snippets in the current collections module. Those examples were excluded since Sphinx assigns a different highlight language to those code-blocks.
In the past, Sphinx used python3 to highlight all the doctest and malformed code blocks (started with : instead of ::). Those blockes had the highlight-python3 CSS class in the generated HTML. For example, see the collections module in Python 3.3.
However, with the recent change in Sphinx (sphinx-doc/sphinx#4137), the doctest blocks are highlighted by pycon, and malformed blocks become default for unknown reason. Therefore, those blocks are not captured by copybutton.js due to a different CSS class name. There are in total 185 doctests and 382 malformed(?) code blocks highlighted by pycon and default language in the latest Python official documentation. Note that the default language has a similar behavior to python3.
This pull request lets code blocks of two additional languages (pycon and default) to add the copybutton.
All occurrences of hightlight-pycon in current Python master: All occurrences of hightlight-default in current Python master: