diff options
author | Fred Drake <fdrake@acm.org> | 2002-10-30 21:32:40 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-10-30 21:32:40 (GMT) |
commit | 4a4734927db2c23f2450d49a085c6143014e3bf9 (patch) | |
tree | 9fe562c190b7d3ace99d6e174a0c21be9cb25f1f | |
parent | 8687609a3907cdb18a168d25fe889e628b3a2384 (diff) | |
download | cpython-4a4734927db2c23f2450d49a085c6143014e3bf9.zip cpython-4a4734927db2c23f2450d49a085c6143014e3bf9.tar.gz cpython-4a4734927db2c23f2450d49a085c6143014e3bf9.tar.bz2 |
More <link> support for generated pages.
-rwxr-xr-x | Doc/tools/mkmodindex | 17 | ||||
-rw-r--r-- | Doc/tools/support.py | 10 |
2 files changed, 24 insertions, 3 deletions
diff --git a/Doc/tools/mkmodindex b/Doc/tools/mkmodindex index 7d5c682..8e869f9 100755 --- a/Doc/tools/mkmodindex +++ b/Doc/tools/mkmodindex @@ -29,6 +29,8 @@ import os import re import sys +from xml.sax.saxutils import quoteattr + import buildindex import support @@ -49,6 +51,21 @@ class IndexOptions(support.Options): program = os.path.basename(sys.argv[0]) print __doc__ % {"program": program} + links = [ + ('author', 'acks.html', 'Acknowledgements'), + ('help', 'about.html', 'About the Python Documentation'), + ] + + def get_header(self): + header = support.Options.get_header(self) + s = '' + for rel, href, title in self.links: + s += '<link rel="%s" href="%s"' % (rel, href) + if title: + s += ' title=' + quoteattr(title) + s += '>\n ' + return header.replace("<link ", s + "<link ", 1) + class Node(buildindex.Node): def __init__(self, link, str, seqno, platinfo): diff --git a/Doc/tools/support.py b/Doc/tools/support.py index 30d4575..cd42fd0 100644 --- a/Doc/tools/support.py +++ b/Doc/tools/support.py @@ -111,10 +111,14 @@ class Options: s = HEAD % self.variables if self.uplink: if self.uptitle: - link = ('<link rel="up" href="%s" title="%s">' - % (self.uplink, self.uptitle)) + link = ('<link rel="up" href="%s" title="%s">\n ' + '<link rel="start" href="%s" title="%s">' + % (self.uplink, self.uptitle, + self.uplink, self.uptitle)) else: - link = '<link rel="up" href="%s">' % self.uplink + link = ('<link rel="up" href="%s">\n ' + '<link rel="start" href="%s">' + % (self.uplink, self.uplink)) repl = " %s\n</head>" % link s = s.replace("</head>", repl, 1) if self.aesop_type: |