| Name | Last modified | Size | Description | |
|---|---|---|---|---|
| Parent Directory | - | |||
| rst2htmlnav.py | 29-Sep-2008 16:04 | 474 | ||
| setup.py | 29-Sep-2008 16:04 | 614 | ||
| writer/ | 29-Sep-2008 16:04 | - | ||
| Author: | Gunnar Schwant |
|---|---|
| Contact: | g.schwant@gmx.de |
| Date: | 2003-06-09 |
Contents
This is the writer which I use to build my homepage: http://schwant.gmxhome.de. [1] The name htmlnav is a short term for HTML with navigation-bars.
Docutils and everything needed to use docutils has to be installed.
Perform the usual setup.py install procedure.
Most parts of the writer are inherited from David Goodger's html4css1. In fact, if no .nav-files do exist in the destination directory, it produces the same output as David's writer.
Go to docutils' "tools"-directory and create a file called "left.nav" with the following contents:
colors | #000000 | #8E8E8E section | Home link | Python | http://www.python.org link | Docutils | http://docutils.sf.net raw | <br> raw | © 2003 MyCompany
Process "test.txt" to HTML using "rst2htmlnav.py":
rst2htmlnav.py test.txt test.html
Open "test.html" in your browser. You will notice the left navigation-bar.
Create a file called "right.nav" in docutils' "tools"-directory. This time the contents are:
colors | #000000 | #8E8E8E section | Contact link | me@MyCompany.org | mailto:me@mycompany.org
Now perform step 2 again and open "test.html" in your browser. You will notice that there is a right navigation-bar now.
Create a file called "top.nav" in docutils' "tools"-directory with the following contents:
color | #C8DBEB cornerpic | ../docs/rst/images/ball1.gif link | Home | test.html link | Python | http://www.python.org link | Docutils | http://docutils.sf.net link | Search | http://www.google.com
Once again perform step 2 and open "test.html" in your browser. Now a top navigation-bar is there, too.
In order to get navigation-bars in the output-page you have to create .nav-files in the destination directory. There are 4 types of .nav-files:
Important
At least one of the files [file].nav and left.nav has to be present. Otherwise no navigation-bars will be added to the output file.
.nav-files contain a one-liner for each navigation-bar-entry. In general such a one-liner is of the form
parameter | value 1 | value 2
These are the different types of parameters:
| Used in: | top.nav |
|---|---|
| Value 1: | Background-color of all navigation-bars. |
| Value 2: | Not used. |
| Example: | color | #8E8E8E sets the navigation-bars' background-color to #8E8E8E. (The default color is white.) |
| Used in: | [file].nav, left.nav, right.nav |
|---|---|
| Value 1: | Background-color of section entries. |
| Value 2: | Background-color of any other (non-section) entry. |
| Example: | colors | #000000 | #8E8E8E sets the background-color to be #000000 (black) for sections to be #8E8E8E (gray) for any other entry. |
| Used in: | top.nav |
|---|---|
| Value 1: | Path to the graphics file which will be displayed in the upper left corner of the top navigation-bar. (The width of a corner-picture should be 150 pixel.) |
| Value 2: | Not used. |
| Example: | cornerpic | pics/home.png sets the path of the corner-picture to pics/home.png. |
| Used in: | [file].nav, left.nav, right.nav |
|---|---|
| Value 1: | Any kind of text. |
| Value 2: | Not used. |
| Example: | raw | <br> will create an empty cell (a spacer) in the navigation-bar. |
| Used in: | [file].nav, left.nav, right.nav |
|---|---|
| Value 1: | Title of the section. |
| Value 2: | Not used. |
| Example: | section | Home will create a section with title Home in the navigation-bar. |
| Used in: | [file].nav, left.nav, right.nav, top.nav |
|---|---|
| Value 1: | Text to be displayed. |
| Value 2: | URL |
| Example: | link | Docutils | http://docutils.sf.net creates a link to Docutils' homepage in the navigation-bar. |