[issue14503] docs:Code not highlighted

New submission from Ramchandra Apte <maniandram01@gmail.com>: In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-t... , two code samples ---------- assignee: docs@python components: Documentation messages: 157551 nosy: docs@python, ramchandra.apte priority: normal severity: normal status: open title: docs:Code not highlighted _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Ramchandra Apte <maniandram01@gmail.com> added the comment: Whoops - In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-t... , two code samples are not highlighted. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: I'm not seeing any unhighlighted examples in that section. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Berker Peksag <berker.peksag@gmail.com> added the comment: I can reproduce. See screenshot.png. ---------- nosy: +berker.peksag Added file: http://bugs.python.org/file25135/screenshot.png _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: Berker: you can reproduce the bug, or the fact that they are highlighted? The png looks like they are highlighted, so I assume the latter. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:
they are highlighted No. Keywords normally appear in bold font, and with another color. This is not the case in these blocks.
Probably because the language detection does not work with the new "yield from" construct. Sphinx should always use the latest Python... ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: Ah, you mean they are not *syntax* highlighted. Now I understand. Sorry for missing that. My understanding is that Sphinx does not use Python directly to parse the code and highlight it, it uses pygments, which uses regexes. So this basically amounts to a feature request for pygments. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment: Not exactly. Sphinx first tries to see if the block is a Python script, and to do so it uses the Python compiler: https://bitbucket.org/birkenfeld/sphinx/src/164f59b2d946/sphinx/highlighting... In case of SyntaxError, it treats the whole block as plain text and does not try to use pygmentq at all. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: Huh. Well, in another issue Georg said it was now possible to upgrade the doc build toolchain to Python3. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Changes by Terry J. Reedy <tjreedy@udel.edu>: ---------- stage: -> needs patch title: docs:Code not highlighted -> docs: 2 code examples not Pygmented (syntax color coded) type: -> behavior versions: +Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Changes by Chris Jerdonek <chris.jerdonek@gmail.com>: ---------- title: docs: 2 code examples not Pygmented (syntax color coded) -> docs: "yield from" breaks Pygments syntax coloring in doc examples _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________

Georg Brandl added the comment: I've updated the version of Pygments used by 3.3 and 3.4 branches, which fixes this and the "raise from" issue. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed versions: +Python 3.4 -Python 2.7, Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14503> _______________________________________
participants (7)
-
Amaury Forgeot d'Arc
-
Berker Peksag
-
Chris Jerdonek
-
Georg Brandl
-
R. David Murray
-
Ramchandra Apte
-
Terry J. Reedy