Commit 437f8d16 authored by Fred Drake's avatar Fred Drake

main(): Include a \label{modindex} in the output so latex won't let us re-use

	the name elsewhere.  This is useful for the logical filenames project,
	since the "modindex" label is hardcoded into .latex2html-init.
parent e01b2497
...@@ -22,6 +22,7 @@ def cmp_items((s1, line1), (s2, line2)): ...@@ -22,6 +22,7 @@ def cmp_items((s1, line1), (s2, line2)):
return rc return rc
def main(): def main():
if sys.argv[1:]: if sys.argv[1:]:
infile = sys.argv[1] infile = sys.argv[1]
...@@ -36,7 +37,7 @@ def main(): ...@@ -36,7 +37,7 @@ def main():
base, ext = os.path.splitext(infile) base, ext = os.path.splitext(infile)
outfile = base + ".ind" outfile = base + ".ind"
ofp = open(outfile, "w") ofp = open(outfile, "w")
ofp.write("\\begin{theindex}\n\n") ofp.write("\\begin{theindex}\n\label{modindex}\n\n")
lines = ifp.readlines() lines = ifp.readlines()
for i in range(len(lines)): for i in range(len(lines)):
if lines[i][0] == '\\': if lines[i][0] == '\\':
......
...@@ -22,6 +22,7 @@ def cmp_items((s1, line1), (s2, line2)): ...@@ -22,6 +22,7 @@ def cmp_items((s1, line1), (s2, line2)):
return rc return rc
def main(): def main():
if sys.argv[1:]: if sys.argv[1:]:
infile = sys.argv[1] infile = sys.argv[1]
...@@ -36,7 +37,7 @@ def main(): ...@@ -36,7 +37,7 @@ def main():
base, ext = os.path.splitext(infile) base, ext = os.path.splitext(infile)
outfile = base + ".ind" outfile = base + ".ind"
ofp = open(outfile, "w") ofp = open(outfile, "w")
ofp.write("\\begin{theindex}\n\n") ofp.write("\\begin{theindex}\n\label{modindex}\n\n")
lines = ifp.readlines() lines = ifp.readlines()
for i in range(len(lines)): for i in range(len(lines)):
if lines[i][0] == '\\': if lines[i][0] == '\\':
......
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