]> granicus.if.org Git - python/commitdiff
More <link> support for generated pages.
authorFred Drake <fdrake@acm.org>
Wed, 30 Oct 2002 21:32:40 +0000 (21:32 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 30 Oct 2002 21:32:40 +0000 (21:32 +0000)
Doc/tools/mkmodindex
Doc/tools/support.py

index 7d5c682022c283b045837b9951fa40bf760f2654..8e869f9266be5c4a6ca51ef5548722e7e82fa025 100755 (executable)
@@ -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):
index 30d4575cb649a48254c31b346b9de381abc1913f..cd42fd0060d46a630eec50178149bdf161791229 100644 (file)
@@ -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: