Sydebar is a browser sidebar generator for Python documentation pages. It can generate Python documentation sidebars for all Python versions, with the documentation pages either local or on a remote web server.
Sydebar parses the documentation index of a specific version of Python, and generates a single, self-contained XHTML document with one panel per section for the following sections:
Additionally, a search panel allows performing searches on the following sources:
python.org, including the mailing list archivescomp.lang.python.* newsgroupsSydebar is released under the GNU General Public License version 2.
Sample sidebars for all documentation versions available on python.org, generated with
default parameters, can be found at this location.
To generate your own sidebar, proceed as follows:
bin/sydebar.py -o Sydebar-current.html
Sydebar-current.html in your browser and override the default settings:
file:///home/user/Sydebar-current.html?fontSize=13&fieldWidth=30&panel=Search
Sydebar requires Python 2.4 or later and probably runs on all platforms where Python runs. It has
been tested on Linux and Windows. The latest version can be downloaded at
this location. Installation is not really necessary, as the sydebar.py script in the
bin folder can be run directly from an unpacked source archive. A system-wide installation
can be performed anyway with the usual distutils command:
python setup.py install
Sydebar generates XHTML sidebars for specific versions of the Python documentation. The generated page must be bookmarked in the browser and set up to be displayed in the sidebar instead of the main browser pane.
This step takes a URL pointing to the index page of the documentation for a specific Python version and a few options as inputs, and outputs a self-contained XHTML file containing the sidebar data and code. It only has to be performed once per documentation URL.
Command line usage information for the program can be displayed with sydebar.py --help:
$ sydebar.py --help
Usage: sydebar.py [options]
Sydebar 1.0 A browser sidebar generator for Python documentation
Copyright (C) 2008 Remy Blank
Sydebar is a browser sidebar generator for Python documentation pages. It can
generate Python documentation sidebars for all Python versions. The
documentation pages can be either local or on a remote web server.
Options:
--debug Show a full traceback when exceptions are raised
during execution.
-h, --help Show this help message and exit.
--version Show the program version and exit.
Input options:
--image-clear=FILE Read the 'clear' image from FILE. The default is
'clear.png'.
--image-icon=FILE Read the 'icon' image from FILE. The default is
'python.ico'.
--image-minus=FILE Read the 'minus' image from FILE. The default is
'minus.png'.
--image-plus=FILE Read the 'plus' image from FILE. The default is
'plus.png'.
--image-search=FILE
Read the 'search' image from FILE. The default is
'search.png'.
-t FILE, --template=FILE
Read the page template from FILE. The default is
'template.html'.
-u URL, --url=URL Generate the sidebar for the Python documentation
located at URL. The default is
'http://www.python.org/doc/2.4.4/'.
Output options:
-a, --all-versions Generate sidebars for all documentation versions
available on python.org. The output file name must
contain a '%s' pattern that will be replaced by the
version string.
-f N, --field-width=N
Set the width of text fields to N characters. The
default is 25.
-n, --no-pack Don't pack the resulting XHTML file (i.e. don't remove
non-significant white space). This will output nicely
indented and readable XHTML.
-o FILE, --output=FILE
Write the output to FILE. If FILE is '-', the output
is written to standard output. The default is '-'.
-p PANEL, --panel=PANEL
Show PANEL when loading the sidebar. PANEL can be one
of Tut, Ref, Lib, Api, Ext, Mod, Search. The default
is to show the module index if it is available, and
the tutorial otherwise.
-s N, --font-size=N
Set the base font size to N pixels. The default is 11.
python.org for the currently installed
Python version:
sydebar.py -o Sydebar-current.html
sydebar.py -o Sydebar-current.html --text-size=15 --field-width=30 --panel=Search
sydebar.py -o Sydebar-2.4.4.html -u file:///usr/share/doc/python-docs-2.4.4/html/index.html
python.org, and write
the output to Sydebar-1.4.html, Sydebar-1.5.html, ...:
sydebar.py -a -o Sydebar-%s.html
The generated sidebar document can now be displayed in the main pane of a browser. To show it in the sidebar, it must be bookmarked specifically.
The sidebar is structured as a deck of panels containing links to various sections of the documentation. Clicking a link opens the corresponding section in the main browser pane. The main features of the sidebar are the following:
+ to show the sub-sections, or on a
– to hide them. The state of all trees is kept when switching panels, and is reset
to "all closed" when reloading the sidebar.Esc to return to the incremental
search field.python.org domain with Google.comp.lang.python.* newsgroups with Google Groups.The appearance of the sidebar content is determined at generation time from the command line options. However, a few parameters can be changed at load-time through URL parameters:
As an example, the following URL loads the sidebar with a font size of 15 pixels, a field width of 30 and initially shows the search panel:
file:///home/user/Sydebar-current.html?fontSize=15&fieldWidth=30&panel=Search
Sydebar has been tested with Python 2.4.4 on Linux and Windows. Moreover, the generated pages have been tested in Firefox 2.0.0.14 and Opera 9.27. This section documents the issues that have appeared during testing, and for which I haven't found a solution yet.
event.preventDefault(). The same happens with page down.If you are using Sydebar, please let me know! I'm especially interested in bug reports, improvement ideas, and compatibility fixes.
Copyright (C) 2008 Remy Blank