summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-03-02 16:26:45 (GMT)
committerFred Drake <fdrake@acm.org>2001-03-02 16:26:45 (GMT)
commitcfef0096f993c929c2e7f4814b43b273db97bd9c (patch)
treecdca0de2173f851f7e6806b9e99c6986dbf0af3c /Doc
parente3955a8ce27ec8a1d74340d41bc8701723646efe (diff)
downloadcpython-cfef0096f993c929c2e7f4814b43b273db97bd9c.zip
cpython-cfef0096f993c929c2e7f4814b43b273db97bd9c.tar.gz
cpython-cfef0096f993c929c2e7f4814b43b273db97bd9c.tar.bz2
Job.build_html(): When formatting HTML into more than one HTML page, and
not doing the \label{foo} --> foo.html transformation (--numeric was specified on the command line), still look to see if there is an "About this document..." node and copy that to "about.html", since the page footers use that as the target.
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/tools/mkhowto32
1 files changed, 25 insertions, 7 deletions
diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto
index a1784c9..f11eec1 100755
--- a/Doc/tools/mkhowto
+++ b/Doc/tools/mkhowto
@@ -368,13 +368,31 @@ class Job:
os.path.join(builddir, self.doc + ".css"))
shutil.copyfile(os.path.join(builddir, self.doc + ".html"),
os.path.join(builddir, "index.html"))
- if max_split_depth != 1 and not self.options.numeric:
- pwd = os.getcwd()
- try:
- os.chdir(builddir)
- self.run("%s %s *.html" % (PERL_BINARY, NODE2LABEL_SCRIPT))
- finally:
- os.chdir(pwd)
+ if max_split_depth != 1:
+ if self.options.numeric:
+ label_file = os.path.join(builddir, "labels.pl")
+ fp = open(label_file)
+ about_node = None
+ target = " = q/about/;\n"
+ x = len(target)
+ while 1:
+ line = fp.readline()
+ if not line:
+ break
+ if line[-x:] == target:
+ line = fp.readline()
+ m = re.search(r"\|(node\d+\.[a-z]+)\|", line)
+ about_node = m.group(1)
+ shutil.copyfile(os.path.join(builddir, about_node),
+ os.path.join(builddir, "about.html"))
+ break
+ else:
+ pwd = os.getcwd()
+ try:
+ os.chdir(builddir)
+ self.run("%s %s *.html" % (PERL_BINARY, NODE2LABEL_SCRIPT))
+ finally:
+ os.chdir(pwd)
def build_text(self, tempdir=None):
if tempdir is None: