diff options
-rw-r--r-- | CHANGES | 7 | ||||
-rw-r--r-- | doc/markup/code.rst | 3 | ||||
-rw-r--r-- | sphinx/highlighting.py | 9 |
3 files changed, 11 insertions, 8 deletions
@@ -27,10 +27,10 @@ Features added * Markup: - - #138: Add an :rst:role:`index` role, to make inline index entries. - - #454: Add more index markup capabilities: marking see/seealso entries, + - #138: Added an :rst:role:`index` role, to make inline index entries. + - #454: Added more index markup capabilities: marking see/seealso entries, and main entries for a given key. - - #460: Allow limiting the depth of section numbers for HTML using the + - #460: Allowed limiting the depth of section numbers for HTML using the :rst:dir:`toctree`\'s ``numbered`` option. - #586: Implemented improved :rst:dir:`glossary` markup which allows multiple terms per definition. @@ -38,6 +38,7 @@ Features added - C++ domain now supports array definitions. - Section headings in :rst:dir:`only` directives are now correctly handled. + - Added ``emphasize-lines`` option to source code directives. * HTML builder: diff --git a/doc/markup/code.rst b/doc/markup/code.rst index 8f6d55247..c0e7e8ebe 100644 --- a/doc/markup/code.rst +++ b/doc/markup/code.rst @@ -98,6 +98,9 @@ emphasize particular lines:: print 'This one is not...' print '...but this one is.' +.. versionchanged:: 1.1 + ``emphasize-lines`` has been added. + Includes ^^^^^^^^ diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 65fe9f7d3..0912ee053 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -101,6 +101,10 @@ class PygmentsBridge(object): self.formatter = self.latex_formatter self.formatter_args['commandprefix'] = 'PYG' + def get_formatter(self, **kwargs): + kwargs.update(self.formatter_args) + return self.formatter(**kwargs) + def unhighlighted(self, source): if self.dest == 'html': return '<pre>' + cgi.escape(source) + '</pre>\n' @@ -212,11 +216,6 @@ class PygmentsBridge(object): # so let it pass unhighlighted return self.unhighlighted(source) - def get_formatter(self, **kwargs_orig): - kwargs = self.formatter_args.copy() - kwargs.update(kwargs_orig) - return self.formatter(**kwargs) - def get_stylesheet(self): if not pygments: if self.dest == 'latex': |