
report at bugs
Apr 19, 2012, 7:32 AM
Post #3 of 5
(44 views)
Permalink
|
|
[issue12947] Examples in library/doctest.html lack the flags
[In reply to]
|
|
Stefano Taschini <taschini [at] ieee> added the comment: As far as I can see, Sphinx has a global setting for trim_doctest_flags but lacks the possibility of locally disabling the trimming. A quick workaround would be to have the following sphinx extension added: class ProxyLexer(object): def __init__(self, underlying): self.__underlying = underlying def __getattr__(self, attr): return getattr(self.__underlying, attr) def setup(app): from sphinx.highlighting import lexers if lexers is not None: lexers['pycon-literal'] = ProxyLexer(lexers['pycon']) lexers['pycon3-literal'] = ProxyLexer(lexers['pycon3']) That would allow blocks marked as .. code-block:: pycon-literal or preceded by .. highlight:: pycon-literal to escape the trimming of doctest flags. If that's of any interest I can submit a patch. ---------- _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue12947> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|