summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-20 21:34:34 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-20 21:34:34 (GMT)
commitc8490c70cdb49105fc99a6dd7b467a8e71149281 (patch)
tree1aac9eb1716cf5f25222db640db7dd8197c996fd /Doc/tools
parent454540774618c35374ecd0042ab689692040c425 (diff)
downloadcpython-c8490c70cdb49105fc99a6dd7b467a8e71149281.zip
cpython-c8490c70cdb49105fc99a6dd7b467a8e71149281.tar.gz
cpython-c8490c70cdb49105fc99a6dd7b467a8e71149281.tar.bz2
Move "everything left one": the TOC now shows each doc directory as a
distinct top-level node. Before they were all nested under an artificial top-level node, uselessly chewing up horizontal space, and ensuring that the only thing the user saw in the TOC upon opening the file was a single collapsed top-level folder.
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/prechm.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/tools/prechm.py b/Doc/tools/prechm.py
index 59a2d21..970ed34 100644
--- a/Doc/tools/prechm.py
+++ b/Doc/tools/prechm.py
@@ -68,15 +68,10 @@ contents_header = '''\
<param name="ImageType" value="Folder">
</OBJECT>
<UL>
-<LI><OBJECT type="text/sitemap">
- <param name="Name" value="Python %s Docs">
- <param name="Local" value="./index.html">
- </OBJECT>
-<UL>
'''
contents_footer = '''\
-</UL></UL></BODY></HTML>
+</UL></BODY></HTML>
'''
object_sitemap = '''\
@@ -124,8 +119,9 @@ class Book:
# Library Doc list of books:
# each 'book' : (Dir, Title, First page, Content page, Index page)
supported_libraries = {
- '2.2': ### Beta!!! fix for actual release
+ '2.2':
[
+ Book('.', 'Main page', 'index'),
Book('.', 'Global Module Index', 'modindex'),
Book('whatsnew', "What's New", 'index', 'contents'),
Book('tut','Tutorial','tut','node2'),
@@ -141,6 +137,7 @@ supported_libraries = {
'2.1.1':
[
+ Book('.', 'Main page', 'index'),
Book('.', 'Global Module Index', 'modindex'),
Book('tut','Tutorial','tut','node2'),
Book('lib','Library Reference','lib','contents','genindex'),
@@ -341,7 +338,7 @@ def do_index(library, output):
output.write('</UL>\n')
def do_content(library, version, output):
- output.write(contents_header % version)
+ output.write(contents_header)
for book in library:
print '\t', book.title, '-', book.firstpage
path = book.directory + "/" + book.firstpage
@@ -356,12 +353,16 @@ def do_content(library, version, output):
# supported_libraries for the version of the docs getting generated.
def do_project(library, output, arch, version):
output.write(project_template % locals())
+ pathseen = {}
for book in library:
directory = book.directory
path = directory + '\\%s\n'
for page in os.listdir(directory):
if page.endswith('.html') or page.endswith('.css'):
- output.write(path % page)
+ fullpath = path % page
+ if fullpath not in pathseen:
+ output.write(fullpath)
+ pathseen[fullpath] = True
def openfile(file):
try: