From: Martin B. <bl...@ir...> - 2003-05-08 06:42:06
|
On Monday 31 March 2003 03:51, David Goodger wrote: > William Dode wrote: > > I want to generate site from rst pages in somes directories. > > Aha! You're looking for a templating system. > > Thanks for the examples. Here are some references that should be of > interest: > > * There's an entry in the to-do list for a templating system: > <http://docutils.sf.net/spec/notes.html#templating-system>. > > * Ollie Rutherfurd has done some work on integrating Docutils & > ht2html: <http://www.rutherfurd.net/articles/rst-ht2html.html>. > > * The docutils/writers/pep_html.py module uses a template file to > generate HTML PEPs. The template file is very similar to the > example you provided. > > > In each directory, i need to know the order of the pages, the title > > of the directory, the first page to show... So i need a simple data > > format. > > ... > > > the config files where i'll need something like yaml : > > http://flibuste.net/__menu > > I would suggest something like RFC-822 headers, which is what ht2html > uses for metadata. The advantage is that they're already in Python's > standard library. Alternatively, reStructuredText field lists are > equivalent although more powerful: they can nest, and they can > contain markup & links etc. If you really want a data structure with > "the same philosophy as RST", that's your answer. Interesting... i also want to do something similar for maintaining a simple intranet site. Basically, the requirements i'm setting for my version of that thing are the following: * individual text files are simple reST documents, with no special headers, except for perhaps some new "bibliographic fields" when needed. The ''titles' of the documents are going to be extracted from reST parsing and be used to construct the index pages automatically. * my goal is to minimize maintenance overhead for our R&D, so i want for any of our developers to just be able to just plop a new file in some directory of our intranet, then run the script at the root, and static pages to be regenerated automatically, much like ht2html, but without going to an intermediate .ht template format (and extracting the extra information i need directly from reST parsing as mentioned above). =20 * I'm assuming that ordering of the index files doesn't matter so much, so i don't want them to bother with having to update an index file, but there would be an optional index file to be able specify the ''title'' or ''subject matter'' of the directory and links to non-reST documents. * A single global template for the whole site * A location bar at the top, much like the BreabCrumbs thingy from oliverr * Automatically generated top-level sections in the side-bar on the left. Maybe i would add a bibliographic field to allow specifying the abbreviation or short name within the index files. Basically, I want a script that i can just run in a directory with a hierarchy of directories populated with reST files and for it to generate reasonable output automatically (it doesn't have to be perfect, it just has to ''work''), similar to ht2html, without having to write links.h or anything at all. I'm willing to compromise on features for automatedness. |