summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-10-07 14:12:20 (GMT)
committerFred Drake <fdrake@acm.org>1998-10-07 14:12:20 (GMT)
commit8c1e114d1af2eae634f5b5a999a34d6ea1386c0d (patch)
treef0189ca64afc6a292ed582eb6e7466bfb2cbae3f
parent56440a58f7a9e4aff1877c86772c846093ea5fd3 (diff)
downloadcpython-8c1e114d1af2eae634f5b5a999a34d6ea1386c0d.zip
cpython-8c1e114d1af2eae634f5b5a999a34d6ea1386c0d.tar.gz
cpython-8c1e114d1af2eae634f5b5a999a34d6ea1386c0d.tar.bz2
Don't attempt to add paragraph and subparagraph sections to the PDF
outline. Work around font-long bogosity caused by ' in docstring.
-rwxr-xr-xDoc/tools/toc2bkm.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/tools/toc2bkm.py b/Doc/tools/toc2bkm.py
index 0a17f46..ca7064b 100755
--- a/Doc/tools/toc2bkm.py
+++ b/Doc/tools/toc2bkm.py
@@ -3,7 +3,7 @@
"""Convert a LaTeX .toc file to some PDFTeX magic to create that neat outline.
The output file has an extension of '.bkm' instead of '.out', since hyperref
-already uses that extension. Let's avoid clashing.
+already uses that extension.
"""
import getopt
@@ -41,6 +41,9 @@ _transition_map = {
('subsubsection', 'chapter'): 3,
}
+INCLUDED_LEVELS = ("chapter", "section", "subsection", "subsubsection")
+
+
def parse_toc(fp, bigpart=None):
toc = top = []
stack = [toc]
@@ -59,6 +62,9 @@ def parse_toc(fp, bigpart=None):
if stype == level:
toc.append(entry)
else:
+ if stype not in INCLUDED_LEVELS:
+ # we don't want paragraphs & subparagraphs
+ continue
direction = _transition_map[(level, stype)]
if direction == OUTER_TO_INNER:
toc = toc[-1][-1]