mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	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!)
This commit is contained in:
		
							parent
							
								
									e07d5cf966
								
							
						
					
					
						commit
						42181dba8e
					
				
					 3 changed files with 18 additions and 2 deletions
				
			
		|  | @ -14,7 +14,8 @@ PYTHON=	   python | ||||||
| WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py | WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py | ||||||
| MKHOWTO=   $(TOOLSDIR)/mkhowto --about $(TOPDIR)/html/stdabout.dat \
 | MKHOWTO=   $(TOOLSDIR)/mkhowto --about $(TOPDIR)/html/stdabout.dat \
 | ||||||
| 		--address $(PYTHONDOCS) --up-link ../index.html \
 | 		--address $(PYTHONDOCS) --up-link ../index.html \
 | ||||||
| 		--up-title "Python Documentation Index" | 		--up-title "Python Documentation Index" \
 | ||||||
|  | 		--global-module-index "../modindex.html" | ||||||
| MKHTML=	   $(MKHOWTO) --html | MKHTML=	   $(MKHOWTO) --html | ||||||
| 
 | 
 | ||||||
| BUILDINDEX=$(TOOLSDIR)/buildindex.py | BUILDINDEX=$(TOOLSDIR)/buildindex.py | ||||||
|  |  | ||||||
|  | @ -332,6 +332,16 @@ sub add_module_idx { | ||||||
|               . "<tt class='module'>$key</tt>$plat###\n"; |               . "<tt class='module'>$key</tt>$plat###\n"; | ||||||
|     } |     } | ||||||
|     close(MODIDXFILE); |     close(MODIDXFILE); | ||||||
|  | 
 | ||||||
|  |     if ($GLOBAL_MODULE_INDEX) { | ||||||
|  |         $prefix = <<MODULE_INDEX_PREFIX; | ||||||
|  | 
 | ||||||
|  | <p> This index only lists modules documented in this manual. | ||||||
|  |   The <em class="citetitle"><a href="$GLOBAL_MODULE_INDEX">Global Module | ||||||
|  |      Index</a></em> lists all modules that are documented in this set | ||||||
|  |   of manuals.</p> | ||||||
|  | MODULE_INDEX_PREFIX | ||||||
|  |     } | ||||||
|     if (!$allthesame) { |     if (!$allthesame) { | ||||||
| 	$prefix .= <<PLAT_DISCUSS; | 	$prefix .= <<PLAT_DISCUSS; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -91,6 +91,7 @@ class Options: | ||||||
|     quiet = 0 |     quiet = 0 | ||||||
|     runs = 0 |     runs = 0 | ||||||
|     numeric = 0 |     numeric = 0 | ||||||
|  |     global_module_index = None | ||||||
|     style_file = os.path.join(TOPDIR, "html", "style.css") |     style_file = os.path.join(TOPDIR, "html", "style.css") | ||||||
|     about_file = os.path.join(TOPDIR, "html", "about.dat") |     about_file = os.path.join(TOPDIR, "html", "about.dat") | ||||||
|     up_link = None |     up_link = None | ||||||
|  | @ -117,7 +118,8 @@ class Options: | ||||||
|                                     "link=", "split=", "logging", "debugging", |                                     "link=", "split=", "logging", "debugging", | ||||||
|                                     "keep", "quiet", "runs=", "image-type=", |                                     "keep", "quiet", "runs=", "image-type=", | ||||||
|                                     "about=", "numeric", "style=", |                                     "about=", "numeric", "style=", | ||||||
|                                     "up-link=", "up-title="] |                                     "up-link=", "up-title=", | ||||||
|  |                                     "global-module-index="] | ||||||
|                                    + list(self.ALL_FORMATS)) |                                    + list(self.ALL_FORMATS)) | ||||||
|         for opt, arg in opts: |         for opt, arg in opts: | ||||||
|             if opt == "--all": |             if opt == "--all": | ||||||
|  | @ -163,6 +165,8 @@ class Options: | ||||||
|                 self.up_link = arg |                 self.up_link = arg | ||||||
|             elif opt == "--up-title": |             elif opt == "--up-title": | ||||||
|                 self.up_title = arg |                 self.up_title = arg | ||||||
|  |             elif opt == "--global-module-index": | ||||||
|  |                 self.global_module_index = arg | ||||||
|             # |             # | ||||||
|             # Format specifiers: |             # Format specifiers: | ||||||
|             # |             # | ||||||
|  | @ -405,6 +409,7 @@ class Job: | ||||||
|         l2hoption(fp, "MAX_SPLIT_DEPTH", options.max_split_depth) |         l2hoption(fp, "MAX_SPLIT_DEPTH", options.max_split_depth) | ||||||
|         l2hoption(fp, "EXTERNAL_UP_LINK", options.up_link) |         l2hoption(fp, "EXTERNAL_UP_LINK", options.up_link) | ||||||
|         l2hoption(fp, "EXTERNAL_UP_TITLE", options.up_title) |         l2hoption(fp, "EXTERNAL_UP_TITLE", options.up_title) | ||||||
|  |         l2hoption(fp, "GLOBAL_MODULE_INDEX", options.global_module_index) | ||||||
|         fp.write("1;\n") |         fp.write("1;\n") | ||||||
|         fp.close() |         fp.close() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fred Drake
						Fred Drake