Index: Doc/tools/sphinxext/pyspecific.py =================================================================== --- Doc/tools/sphinxext/pyspecific.py (revision 65100) +++ Doc/tools/sphinxext/pyspecific.py (working copy) @@ -12,6 +12,7 @@ ISSUE_URI = 'http://bugs.python.org/issue%s' from docutils import nodes, utils +from sphinx.directives import highlightlang_directive as real_highlightlang def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) @@ -19,6 +20,10 @@ refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) return [refnode], [] +def highlightlang_directive(name, arguments, *args, **kwargs): + if arguments[0] == "python": + arguments[0] = "python3" + return real_highlightlang(name, arguments, *args, **kwargs) # Support for building "topic help" for pydoc @@ -85,4 +90,5 @@ def setup(app): app.add_role('issue', issue_role) + app.add_directive('highlightlang', highlightlang_directive, 0, (1, 0, 0)) app.add_builder(PydocTopicsBuilder) Index: Doc/conf.py =================================================================== --- Doc/conf.py (revision 65100) +++ Doc/conf.py (working copy) @@ -63,7 +63,10 @@ # unit titles (such as .. function::). add_module_names = True +# The default lexer for pygments +pygments_default_lexer = 'python3' + # Options for HTML output # -----------------------