Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42181db

Browse files
committed
Added a --global-module-index option to specify a (possibly relative) URL
to the Global Module Index for a set of documents. This is used to include a reference to the global index from the per-document module indexes, so that it is just a little easier to find. (Someone suggested this, but I do not remember who. Please let me know if it was you -- thanks!)
1 parent e07d5cf commit 42181db

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

Doc/html/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ PYTHON= python
1414
WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py
1515
MKHOWTO= $(TOOLSDIR)/mkhowto --about $(TOPDIR)/html/stdabout.dat \
1616
--address $(PYTHONDOCS) --up-link ../index.html \
17-
--up-title "Python Documentation Index"
17+
--up-title "Python Documentation Index" \
18+
--global-module-index "../modindex.html"
1819
MKHTML= $(MKHOWTO) --html
1920

2021
BUILDINDEX=$(TOOLSDIR)/buildindex.py

Doc/perl/l2hinit.perl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ sub add_module_idx {
332332
. "<tt class='module'>$key</tt>$plat###\n";
333333
}
334334
close(MODIDXFILE);
335+
336+
if ($GLOBAL_MODULE_INDEX) {
337+
$prefix = <<MODULE_INDEX_PREFIX;
338+
339+
<p> This index only lists modules documented in this manual.
340+
The <em class="citetitle"><a href="$GLOBAL_MODULE_INDEX">Global Module
341+
Index</a></em> lists all modules that are documented in this set
342+
of manuals.</p>
343+
MODULE_INDEX_PREFIX
344+
}
335345
if (!$allthesame) {
336346
$prefix .= <<PLAT_DISCUSS;
337347

Doc/tools/mkhowto

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class Options:
9191
quiet = 0
9292
runs = 0
9393
numeric = 0
94+
global_module_index = None
9495
style_file = os.path.join(TOPDIR, "html", "style.css")
9596
about_file = os.path.join(TOPDIR, "html", "about.dat")
9697
up_link = None
@@ -117,7 +118,8 @@ class Options:
117118
"link=", "split=", "logging", "debugging",
118119
"keep", "quiet", "runs=", "image-type=",
119120
"about=", "numeric", "style=",
120-
"up-link=", "up-title="]
121+
"up-link=", "up-title=",
122+
"global-module-index="]
121123
+ list(self.ALL_FORMATS))
122124
for opt, arg in opts:
123125
if opt == "--all":
@@ -163,6 +165,8 @@ class Options:
163165
self.up_link = arg
164166
elif opt == "--up-title":
165167
self.up_title = arg
168+
elif opt == "--global-module-index":
169+
self.global_module_index = arg
166170
#
167171
# Format specifiers:
168172
#
@@ -405,6 +409,7 @@ class Job:
405409
l2hoption(fp, "MAX_SPLIT_DEPTH", options.max_split_depth)
406410
l2hoption(fp, "EXTERNAL_UP_LINK", options.up_link)
407411
l2hoption(fp, "EXTERNAL_UP_TITLE", options.up_title)
412+
l2hoption(fp, "GLOBAL_MODULE_INDEX", options.global_module_index)
408413
fp.write("1;\n")
409414
fp.close()
410415

0 commit comments

Comments
 (0)