]> granicus.if.org Git - python/commitdiff
Do a little bit more to try and add <link> elements to the header, not that
authorFred Drake <fdrake@acm.org>
Mon, 22 Oct 2001 15:07:16 +0000 (15:07 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 22 Oct 2001 15:07:16 +0000 (15:07 +0000)
Mozilla 0.9.5 can make intelligent use of them.  Specifically, this causes
the "Acknowledgements" and "Global Module Index" pages to acquire "up"
links in the Mozilla "Site Navigation Bar".
This partially responds to SF bug #469772.

Doc/tools/support.py

index 836adf4381cbdf163b0714661d2a4b2e0c2e501b..bfd86cee61b87ff685a0947d9ee6db8c8fd6a494 100644 (file)
@@ -87,7 +87,16 @@ class Options:
         raise getopt.error("option %s not recognized" % opt)
 
     def get_header(self):
-        return HEAD % self.variables
+        s = HEAD % self.variables
+        if self.uplink:
+            if self.uptitle:
+                link = ('<link rel="up" href="%s" title="%s">'
+                        % (self.uplink, self.uptitle))
+            else:
+                link = '<link rel="up" href="%s">' % self.uplink
+            repl = "  %s\n</head>" % link
+            s = s.replace("</head>", repl, 1)
+        return s
 
     def get_footer(self):
         return TAIL % self.variables