Commit 4a473492 authored by Fred Drake's avatar Fred Drake

More <link> support for generated pages.

parent 8687609a
...@@ -29,6 +29,8 @@ import os ...@@ -29,6 +29,8 @@ import os
import re import re
import sys import sys
from xml.sax.saxutils import quoteattr
import buildindex import buildindex
import support import support
...@@ -49,6 +51,21 @@ class IndexOptions(support.Options): ...@@ -49,6 +51,21 @@ class IndexOptions(support.Options):
program = os.path.basename(sys.argv[0]) program = os.path.basename(sys.argv[0])
print __doc__ % {"program": program} 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): class Node(buildindex.Node):
def __init__(self, link, str, seqno, platinfo): def __init__(self, link, str, seqno, platinfo):
......
...@@ -111,10 +111,14 @@ class Options: ...@@ -111,10 +111,14 @@ class Options:
s = HEAD % self.variables s = HEAD % self.variables
if self.uplink: if self.uplink:
if self.uptitle: if self.uptitle:
link = ('<link rel="up" href="%s" title="%s">' link = ('<link rel="up" href="%s" title="%s">\n '
% (self.uplink, self.uptitle)) '<link rel="start" href="%s" title="%s">'
% (self.uplink, self.uptitle,
self.uplink, self.uptitle))
else: 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 repl = " %s\n</head>" % link
s = s.replace("</head>", repl, 1) s = s.replace("</head>", repl, 1)
if self.aesop_type: if self.aesop_type:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment