linguist: Regression: Add support for highlighting "pycon" (Python console/doctest)
Please add back support for using the “pycon” syntax highlighting that worked for years when GitHub was using Pygments. Linguist apparently lacks support for this. It’s probably just a variation of the highlighter for Python or for Python tracebacks, if that is supported (hmmm, is it?)
MIME type: text/x-python-doctest
Note that the following snippet using “pycon” is not highlighted. It used to be highlighted nicely when GitHub used Pygments:
>>> try:
... from io import StringIO
... except ImportError:
... from StringIO import StringIO
The “python” highlighter does a reasonable job. It would be nicer if it “>>>” and “…” were colored differently but this is not bad.
>>> try:
... from io import StringIO
... except ImportError:
... from StringIO import StringIO
Experiment using “pytb”:
>>> try:
... from io import StringIO
... except ImportError:
... from StringIO import StringIO
“pycon” lexer is documented at http://pygments.org/docs/lexers/#lexers-for-python-and-related-languages
Demo of it using Pygments: http://pygments.org/demo/1061247/?style=default
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 29 (11 by maintainers)
Commits related to this issue
- Add highlighting for a Python console session or doctest with ">>>" and "..." at beginning of lines. This is the format that was supported by the `pycon` lexer in Pygments. As a bonus, I also added... — committed to msabramo/language-python by msabramo 9 years ago
- README.rst: Add teaser (with `pycon` lexer) Because a teaser on the PyPI page is nice and changing the lexer from `doctest` to `pycon` will allow it to render in nice color on PyPI (and in the future... — committed to msabramo/characteristic by msabramo 9 years ago
- README.rst: Add teaser (with `pycon` lexer) Because a teaser on the PyPI page is nice and changing the lexer from `doctest` to `pycon` will allow it to render in nice color on PyPI (and in the future... — committed to msabramo/characteristic by msabramo 9 years ago
- README.rst: Add teaser (with `pycon` lexer) Because a teaser on the PyPI page is nice and changing the lexer from `doctest` to `pycon` will allow it to render in nice color on PyPI (and in the future... — committed to msabramo/characteristic by msabramo 9 years ago
- Minor tweak; correct markup from python to pycon Sadly GitHub's colour rendering of ``pycon`` blocks is currently broken: https://github.com/github/linguist/issues/1939 Some of the examples look O... — committed to peterjc/biopython_workshop by peterjc 9 years ago
- Use `pycon` for console code blocks in README Note that GitHub doesn't actually render `pycon` anymore (github/linguist#1939), but maybe it will rise again one day. — committed to nationalparkservice/iyore by deleted user 8 years ago
I’d like to see “pycon” syntax highlighting working again, too.
Wasted some time on research why this isn’t working anymore until I found this issue. 😦