Friday, August 22, 2008

The rest2web template of awesomeness

Now that classes are starting again, it's time to create course web pages. As I mentioned earlier, I'm using rest2web to generate most of the course web pages.

One really nice feature of rest2web is that the template page (used as a basis for all generated web pages) can contain arbitrary chunks of python code. One thing I noticed about my site design was that the sidebar (containing navigation links) was nice for index documents, but distracting for "leaf" documents such as assignment descriptions, lecture notes, etc.

So, I put in a few lines of code to check the page being generated (available from the pagename variable: see the rest2web template documentation) to see if it's an index page, and if so, suppress the sidebar. I needed to futz a tiny bit with the CSS styles, but overall it was an extremely easy change.

My CS 200 page shows how the generated sites look. Given how much easier it is to author reStructuredText documents than HTML, I think I'm getting awfully close to web content nirvana.

Feel free to use/modify/steal my rest2web template and CSS stylesheet files.

No comments: