Creating a Site

A rest2web Site


When you run rest2web it scans the start directory. The first thing it does is check the file index.txt. This will either be the content for the index page, or the restindex will have an index-file keyword which will tell it which file is the index page.

It then builds the pages one by one for this directory. If this directory has any subdirectories, it adds them to a list of directories to scan. If the subdirectory also has an index.txt file then it checks it for details to add to the index it is currently working on. Having done all the pages in this directory, it then builds the index page (which will usually include a link to all the pages in this section).

Having completed this directory it then takes the next directory in its list and repeats the whole process for that. rest2web does this until it has no more directories in its list [1], by which time the site is complete.

When building pages it generates the html and compares it with the equivalent file in the compare_directory. If the two are not identical [2] it saves the new page in the target_directory, creating subdirectories if necessary.

When generating the html it first deals with the content. If this is already html then no processing needs doing, if the content it is reST format it must be run through docutils first. This forms the page body. The template is then processed - see the templating page for more details. Embedded code is executed and the pages saved as appropriate.

The Index File

A file will only be processed if it starts with a restindex. This is how we can have our template files (template.txt) in the same directory as our other content, without rest2web attempting to turn it into a page.

Also important is the fact that rest2web won't process a directory if it doesn't have an index.txt file. Sometimes this might only contain the restindex with a single value, index-file, but it must be present if you want rest2web to process the directory.

Armed with this knowledge, you should be able to use rest2web to simply build your sites and link them together.


[1]Known as the directory stack.
[2]i.e. the site has not yet been built, or it has changed since the last time it was built.

Return to Top
Part of the rest2web Docs
Page last modified Sat Jun 25 19:11:57 2005. Logo Support This Project

Certified Open Source