Issue #325 resolved

HTML line highlighting (GeSHi like)

Pierre Bourdon
created an issue

I just created a patch which allows the user to give a "hl_lines" list as an option to the HtmlFormatter, then the formatter will use a special background on those lines (surrounded by <span class="hll"></span>).

The patch is attached to this ticket.

Todo: enhance this patch to make it generates the needed css class (span.hll).

Comments (4)

  1. gbrandl

    Added support for specifying a highlight color to styles, added some default highlight colors, and added auto conversion of specified lines to int, to enable command line usage.

    Committed [623c99598be4].

  2. thatch

    Patch looks pretty clean. We should probably short-circuit the call to _highlight_lines if no hl_lines is specified, for speed. Did you have a specific color in mind for the default highlighting, delroth?

  3. Log in to comment