[DAS2] template-based spec generation

Andrew Dalke dalke at dalkescientific.com
Thu Mar 31 07:46:30 UTC 2005


I've checked in the code for generating the specification
from a template.  You can see the result (for now) at
   http://www.dalkescientific.com/das2_get.new.html

I haven't changed the original spec.  To compare see
   http://www.dalkescientific.com/das2_get.html

The changes I made were:

1) pull out the XML, tab-delimited, and text examples
into individual files.  These will be used as part of
the validation, to help ensure that the examples in
the spec are valid.

2) write Relax NG schema definitions for all of the
XML files.  I used the "compact" notation.  The
schema are stored in files ending with ".rnc".

3) wrote a Makefile to turn the .rnc files into
.rng and .dtd files.

4) figure out how to get documentation from the
.rng file, so I can insert the documentation
directly into the spec

5) Switch to a template-based system for the spec.
I chose the Zope Page Template language ("ZPT").

6) Write 'convert_template.py' to convert the
template into the final HTML.  For it to work
you will need to install ElementTree and ZPT
   ElementTree http://effbot.org/zone/element-index.htm
   ZPT at http://zpt.sourceforge.net/

It includes a few special commands to insert
a file and to generate HTML documentation given
the comments in the schema definitions.

The latter uses a "macro" so that all of the HTML
documentation is consistent.

I also have links to the RNC/RNG/DTD files but
they won't work in the above link.


I do know the result doesn't flow as smoothly as
the original spec.  I wanted people to see what
it could do.  If we go this route I'll clean up
the text and check in the ElementTree and ZPT
modules so people like Lincoln don't need to
deal with augmenting their local Python install.

In the meanwhile I've been working on the validation
system proper.

					Andrew
					dalke at dalkescientific.com




More information about the DAS2 mailing list