Commit Graph
4 Commits
Author SHA1 Message Date
Mark Lodato 2c0f936e6b add :emphasize-lines: option to source-code and literal-include
Add a new option, :emphasize-lines:, to the source-code and
literal-include directives.  The format is the same as the :lines:
option for literal-include.  The resulting list of lines is passed to
the Pygments formatter as 'hl_lines', which is only honored by the HTML
formatter.
2011-07-06 22:58:19 -04:00
Mark Lodato b9279ca1e3 add 'highlight_args' option for literal_block nodes
For the HTML and LaTeX writers, if 'highlight_args' is set on
a literal_block node, this is taken as a dictionary of keyword arguments
to pass to PygmentsBridge.highlight_block.  This allows custom
directives to directly set formatter options.
2011-07-06 22:47:32 -04:00
Mark Lodato 94aab04ecb PygmentsBridge: pass keyword arguments to Pygments
In Pygments.highlight_block, pass all extra keyword arguments, including
linenos, directly to the Pygments formatter.  This allows custom
directives to use other Pygments features.
2011-07-06 22:05:22 -04:00
Mark Lodato cab5a5edc1 PygmentsBridge: construct new formatter each time
Previously, we pre-constructed two different formatters, one with line
numbers and one without.  This made the code rather confusing and also
was not scalable for options that take arguments, such as 'hl_lines'.
Now, we construct a new HTMLFormatter or LatexFormatter on each call to
highlight_block().
2011-07-06 21:52:10 -04:00