summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-03-02 16:22:56 (GMT)
committerFred Drake <fdrake@acm.org>1999-03-02 16:22:56 (GMT)
commit7f492ad7b89de798bbb6d4b5f2872cd00f36cfbc (patch)
treec30470c3507feb48ab6f108340c342a351110024
parent75ab7a6fa4885d511bf4e2f60f9cfa2be4620b70 (diff)
downloadcpython-7f492ad7b89de798bbb6d4b5f2872cd00f36cfbc.zip
cpython-7f492ad7b89de798bbb6d4b5f2872cd00f36cfbc.tar.gz
cpython-7f492ad7b89de798bbb6d4b5f2872cd00f36cfbc.tar.bz2
Be more flexible to support platform annotations.
-rwxr-xr-xDoc/tools/mkmodindex30
1 files changed, 25 insertions, 5 deletions
diff --git a/Doc/tools/mkmodindex b/Doc/tools/mkmodindex
index 893771e..16aa109 100755
--- a/Doc/tools/mkmodindex
+++ b/Doc/tools/mkmodindex
@@ -10,7 +10,8 @@ import sys
_rx = re.compile(
- '<dt><a href="(module-.*\.html)">([a-zA-Z_][a-zA-Z0-9_.]*)</a>')
+ '<dt><a href="(module-.*\.html)">'
+ '([a-zA-Z_][a-zA-Z0-9_.]*(\s*<em>\(.*\)</em>)?)</a>')
def main():
outputfile = "-"
@@ -32,6 +33,7 @@ def main():
#
nodes = []
seqno = 0
+ has_plat_flag = 0
for ifn in args:
if ifn == "-":
ifp = sys.stdin
@@ -47,14 +49,23 @@ def main():
if m:
# This line specifies a module!
basename, modname = m.group(1, 2)
+ has_plat_flag = has_plat_flag or m.group(3)
linkfile = os.path.join(dirname, basename)
- nodes.append(buildindex.Node('<a href="%s">' % linkfile,
- "<tt>%s</tt>" % modname,
- seqno))
+ nodes.append(buildindex.Node(
+ '<a href="%s">' % linkfile,
+ "<tt class=module>%s</tt>" % modname,
+ seqno))
seqno = seqno + 1
ifp.close()
+ #
+ # Generate all output:
+ #
num_nodes = len(nodes)
- html = HEAD + buildindex.process_nodes(nodes, columns, letters) + TAIL
+ # Here's the HTML generation:
+ parts = [HEAD, buildindex.process_nodes(nodes, columns, letters), TAIL]
+ if has_plat_flag:
+ parts.insert(1, PLAT_DISCUSS)
+ html = string.join(parts, '')
program = os.path.basename(sys.argv[0])
if outputfile == "-":
sys.stdout.write(html)
@@ -97,6 +108,15 @@ HEAD = """\
<b class=navlabel>Up:</b> <span class=sectref><A
HREF="./">Python Documentation Index</A></span>
<br><hr></div>
+
+<h2>Global Module Index</h2>
+
+"""
+
+PLAT_DISCUSS = """
+<p> Some module names are followed by an annotation indicating what
+platform they are available on.</p>
+
"""
TAIL = """