[Python-checkins] python/dist/src/Doc/tools mkmodindex,1.14,1.15 support.py,1.8,1.9
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Wed, 30 Oct 2002 13:32:42 -0800
Update of /cvsroot/python/python/dist/src/Doc/tools
In directory usw-pr-cvs1:/tmp/cvs-serv19765/tools
Modified Files:
mkmodindex support.py
Log Message:
More <link> support for generated pages.
Index: mkmodindex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkmodindex,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** mkmodindex 16 Oct 2002 15:29:07 -0000 1.14
--- mkmodindex 30 Oct 2002 21:32:39 -0000 1.15
***************
*** 30,33 ****
--- 30,35 ----
import sys
+ from xml.sax.saxutils import quoteattr
+
import buildindex
import support
***************
*** 49,52 ****
--- 51,69 ----
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)
Index: support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/support.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** support.py 30 Oct 2002 17:05:03 -0000 1.8
--- support.py 30 Oct 2002 21:32:40 -0000 1.9
***************
*** 112,119 ****
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)
--- 112,123 ----
if self.uplink:
if 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">\n '
! '<link rel="start" href="%s">'
! % (self.uplink, self.uplink))
repl = " %s\n</head>" % link
s = s.replace("</head>", repl, 1)