summaryrefslogtreecommitdiff
path: root/docutils/writers/html4css1
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2015-03-06 15:43:11 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2015-03-06 15:43:11 +0000
commit31a03d85f0d4bc27e3902cd97057a5041b9d4deb (patch)
treea555cdc7343716f8ed3e58bc53d33dacbd7e0f4f /docutils/writers/html4css1
parenteb91d6a384745d3c47acb9424774866986733427 (diff)
downloaddocutils-31a03d85f0d4bc27e3902cd97057a5041b9d4deb.tar.gz
New CSS 2.1 style-sheet for xhtml11 writer.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7809 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/writers/html4css1')
-rw-r--r--docutils/writers/html4css1/__init__.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/docutils/writers/html4css1/__init__.py b/docutils/writers/html4css1/__init__.py
index 9ceb7fde1..e031367b3 100644
--- a/docutils/writers/html4css1/__init__.py
+++ b/docutils/writers/html4css1/__init__.py
@@ -305,7 +305,8 @@ class HTMLTranslator(nodes.NodeVisitor):
# A heterogenous stack used in conjunction with the tree traversal.
# Make sure that the pops correspond to the pushes:
self.context = []
- self.topic_classes = []
+
+ self.topic_classes = [] # TODO: replace with self_in_contents
self.colspecs = []
self.compact_p = True
self.compact_simple = False
@@ -568,6 +569,7 @@ class HTMLTranslator(nodes.NodeVisitor):
and 'open' not in node['classes']
and (self.compact_simple
or self.topic_classes == ['contents']
+ # TODO: self.in_contents
or self.check_simple_list(node))))
def visit_bullet_list(self, node):
@@ -964,11 +966,10 @@ class HTMLTranslator(nodes.NodeVisitor):
self.context.append('<a class="fn-backref" href="#%s">'
% backrefs[0])
else:
- i = 1
- for backref in backrefs:
+ # Python 2.4 fails with enumerate(backrefs, 1)
+ for (i, backref) in enumerate(backrefs):
backlinks.append('<a class="fn-backref" href="#%s">%s</a>'
- % (backref, i))
- i += 1
+ % (backref, i+1))
self.context.append('<em>(%s)</em> ' % ', '.join(backlinks))
self.context += ['', '']
else:
@@ -1676,10 +1677,13 @@ class HTMLTranslator(nodes.NodeVisitor):
def visit_topic(self, node):
self.body.append(self.starttag(node, 'div', CLASS='topic'))
self.topic_classes = node['classes']
+ # TODO: replace with ::
+ # self.in_contents = 'contents' in node['classes']
def depart_topic(self, node):
self.body.append('</div>\n')
self.topic_classes = []
+ # TODO self.in_contents = False
def visit_transition(self, node):
self.body.append(self.emptytag(node, 'hr', CLASS='docutils'))