summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-07-22 20:46:30 +0200
committergbrandl <devnull@localhost>2007-07-22 20:46:30 +0200
commit63e396142e12ab8fa5f87ae6cd9497aeff0852a7 (patch)
tree9a976fb5908e9162329b3c6070bfefe1a82ba724
parent9a6d5c7859f76f54de13351cba15d0a9006def9a (diff)
downloadpygments-63e396142e12ab8fa5f87ae6cd9497aeff0852a7.tar.gz
[svn] Give the linenos table a CSS class to be able to format it differently
from other tables.
-rw-r--r--CHANGES2
-rw-r--r--pygments/formatters/html.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 09b4e7dc..82793965 100644
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,8 @@ Version 0.9
- Added the ``lineanchors`` option to the HTML formatter, thanks to
Ian Charnas for the idea.
+- Give the line numbers table a CSS class in the HTML formatter.
+
- Added 256-color terminal formatter.
- Added ActionScript lexer.
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 31135428..484a00ad 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -199,6 +199,10 @@ class HtmlFormatter(Formatter):
If you set this option, the default selector for `get_style_defs()`
will be this class.
+ *New in Pygments 0.9:* If you select the ``'table'`` line numbers, the
+ wrapping table will have a CSS class of this string plus ``'table'``,
+ the default is accordingly ``'highlighttable'``.
+
`cssstyles`
Inline CSS styles for the wrapping ``<div>`` tag (default: ``''``).
@@ -461,7 +465,8 @@ class HtmlFormatter(Formatter):
ls = '\n'.join([(i%st == 0 and ('%*d' % (mw, i)) or '')
for i in range(fl, fl + lncount)])
- yield 0, ('<table><tr><td class="linenos"><pre>' +
+ yield 0, ('<table class="%stable">' % self.cssclass +
+ '<tr><td class="linenos"><pre>' +
ls + '</pre></td><td class="code">')
yield 0, dummyoutfile.getvalue()
yield 0, '</td></tr></table>'