New submission from Amaury Forgeot d'Arc: The new doc framework highlights python code, and looks very nice. However, some snippets are not parseable by the compiler, and are thus left unhighlighted. For example: http://docs.python.org/dev/whatsnew/2.6.html#the-contextlib-module
The vast majority of misses is because of lines containing "...", which is not a valid expression (except in slices). The attached patch tries to recognize some common patterns, and replaces "..." by some valid identifier; "... continue processing ..." is also transformed. Note that the replacements are done only to get a better answer to "is this block a python code"; pygment still works on the original string. I checked that all new highlighted blocks are actually python snippets. (actually, except one in configfile.rst; but others similar blocks on the same page were already wrongly given to the python lexer) The patch also corrects some easy syntax errors in samples. ---------- components: Documentation, Documentation tools (Sphinx) files: doc_highlight.patch keywords: patch messages: 62623 nosy: amaury.forgeotdarc, georg.brandl severity: normal status: open title: doc: better detection of python snippets for highliting versions: Python 2.6 Added file: http://bugs.python.org/file9480/doc_highlight.patch __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2154> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com