[Pydotorg-www] About the new build system
Manlio Perillo
manlio_perillo at libero.it
Tue Aug 7 09:01:12 CEST 2007
Manlio Perillo ha scritto:
> Hi.
>
> I'm the maintainer of the python.it web site.
>
> We are using a modified version of ht2html, but it has many problems.
>
> I'm planning to update the software but it seems that the new build
> system for python.org has all the features I need.
>
I do not know if someone is interested, but here is the features I'm
planning to add:
1) split the software into separate modules:
* loader.py:
this module is responsible for the loading of the page content.
It must return an rfc822 message and a metadata dictionary.
The metadata will contain the filename of the content file, and
the list of dependencies
* parser.py:
this module is responsible for the parsing of YML files
* generator.py:
the main module that generate the html pages with the navigation
links.
There should be a function createContext (for creating a Mako
context for a page) that the user can override.
* build.py:
the driver
2) generic formatter/fragment renderer
Add a formatter register where to register a formatter for a given
content type (like rst_html.process_rst for reST)
3) extend the supported headers:
* the Content-Type header will supports an additional parameter where
one can explicitly specify the formatter to use
(Content-Type: text/plain;formatter="myformatter")
* add an Include header (I need this because some contents on
python.it came from a separate section of the Subversion
repository)
Include: glossary.xml;
Content-Type: application/xml;formatter="glossary_formatter"
4) generic support for yml files like newsindex.yml
* using the pyramid extensions to YAML, there should be no need
to write a separate function to parse each of such file.
As an example a reST text in the newsindex.yml uses the !rest
directive, so the code knows how to format it.
* a page fragment that needs, as an example, newsindex.yml,
can add a Resource header, that declares the resource it needs
(that is, the "absolute"[1] path where to find that resource)
* the template then, can call
load_resource('newsindex.yml', $(resources))
(using Mako namespace directive, instead of passing the function in
the context)
5) all the template should go on a template directory
(and the user can override this directory via command line).
Maybe all the resources (newsindex.py, sigindex.yml, sigindex.yml)
should go in the same "resources" directory?
[1] All the paths should be relative.
The base paths are specified in the build.py module
These are just a few ideas (and I'm not sure that I will be able to
implement all of them)
Thanks and regards Manlio Perillo
More information about the Pydotorg-www
mailing list