Module prechm
[hide private]
[frames] | no frames]

Module prechm

Makes the necesary files to convert from plain html of Python 1.5 and 1.5.x Documentation to Microsoft HTML Help format version 1.1 Doesn't change the html's docs.

by hernan.foffani@iname.com no copyright and no responsabilities.

modified by Dale Nagata for Python 1.5.2

Renamed from make_chm.py to prechm.py, and checked into the Python project, 19-Apr-2002 by Tim Peters. Assorted modifications by Tim and Fred Drake. Obtained from Robin Dunn's .chm packaging of the Python 2.2 docs, at <http://alldunn.com/python/>.

Classes [hide private]
Book
AlmostNullWriter
HelpHtmlParser
IdxHlpHtmlParser
TocHlpHtmlParser
Functions [hide private]
 
addhtml(s)
 
index(path, indexpage, output)
 
content(path, contentpage, output)
 
do_index(library, output)
 
do_content(library, version, output)
 
do_project(library, output, arch, version)
 
openfile(file)
 
usage()
 
do_it(args=None)
Variables [hide private]
  usage_mode = '\nUsage: prechm.py [-c] [-k] [-p] [-v 1.5[.x]] f...
  project_template = '\n[OPTIONS]\nCompiled file=%(arch)s.chm\nC...
  contents_header = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//E...
  contents_footer = '</UL></BODY></HTML>\n'
  object_sitemap = '<OBJECT type="text/sitemap">\n <param nam...
  stop_list = '\na and are as at\nbe but by\nfor\nif in ...
  supported_libraries = {'2.5': [Book('.', 'Main page', 'index')...

Imports: sys, os, NullWriter, AbstractFormatter, HTMLParser, getopt, cgi


Variables Details [hide private]

usage_mode

Value:
'''
Usage: prechm.py [-c] [-k] [-p] [-v 1.5[.x]] filename
    -c: does not build filename.hhc (Table of Contents)
    -k: does not build filename.hhk (Index)
    -p: does not build filename.hhp (Project File)
    -v 1.5[.x]: makes help for the python 1.5[.x] docs
        (default is python 1.5.2 docs)
'''

project_template

Value:
'''
[OPTIONS]
Compiled file=%(arch)s.chm
Contents file=%(arch)s.hhc
Default Window=%(arch)s
Default topic=index.html
Display compile progress=No
Full text search stop list file=%(arch)s.stp
...

contents_header

Value:
'''<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1"\
>
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<OBJECT type="text/site properties">
...

object_sitemap

Value:
'''<OBJECT type="text/sitemap">
    <param name="Name" value="%s">
    <param name="Local" value="%s">
</OBJECT>
'''

stop_list

Value:
'''
a  and  are  as  at
be  but  by
for
if  in  into  is  it
near  no  not
of  on  or
such
...

supported_libraries

Value:
{'2.5': [Book('.', 'Main page', 'index'), Book('.', 'Global Module Ind\
ex', 'modindex'), Book('whatsnew', "What's New", 'index', 'contents'),\
 Book('tut', 'Tutorial', 'tut', 'node2'), Book('lib', 'Library Referen\
ce', 'lib', 'contents', 'genindex'), Book('ref', 'Language Reference',\
 'ref', 'contents', 'genindex'), Book('mac', 'Macintosh Reference', 'm\
ac', 'contents', 'genindex'), Book('ext', 'Extending and Embedding', '\
ext', 'contents'), Book('api', 'Python/C API', 'api', 'contents', 'gen\
index'), Book('doc', 'Documenting Python', 'doc', 'contents'), Book('i\
...