|
From: David G. <go...@us...> - 2002-09-21 02:55:36
|
Richard Jones wrote: > See PEP 258 for a description of the processing framework itself. > That works along the basic lines of: > > 1. read from a source document, parsing the structure out of it and > creating a DOM tree > (http://docutils.sourceforge.net/spec/doctree.html) > 2. optionally do some transforms on the tree (NOOP for current ReST > reader) Not precisely true. In fact, there are several transforms that are done before the doc tree is handed off to the writer: doc title, docinfo, references, footnotes, substitutions, etc. However, please note that the present method of applying transforms is due for an overhaul. I'm thinking of moving the responsibility for running the transforms away from the Reader & Writer and into a new intermediate class, perhaps just a super-Transform. Readers, Writers, and other objects will register the transforms they want applied, into a list sorted by priority. The transforms will be applied to the doc tree in order. Transforms may insert further transforms into the list dynamically (which would be re-sorted). Transforms that are now associated with the Reader will simply have higher ("to be run earlier") priority. -- David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |