Skip to content

Commit

Permalink
Move "everything left one": the TOC now shows each doc directory as a
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tim-one committed Apr 20, 2002
1 parent 4545407 commit c8490c7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Doc/tools/prechm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,10 @@
<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 = '''\
Expand Down Expand Up @@ -124,8 +119,9 @@ def __init__(self, directory, title, firstpage,
# 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'),
Expand All @@ -141,6 +137,7 @@ def __init__(self, directory, title, firstpage,

'2.1.1':
[
Book('.', 'Main page', 'index'),
Book('.', 'Global Module Index', 'modindex'),
Book('tut','Tutorial','tut','node2'),
Book('lib','Library Reference','lib','contents','genindex'),
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit c8490c7

Please sign in to comment.