[Doc-SIG] DPS components

David Goodger goodger@users.sourceforge.net
Tue, 18 Sep 2001 17:44:19 -0400


I like Tony's name for the outputter: "writer". Generalizing, it fits
my idea of separation of components (see "Modes and Styles" in
http://docstring.sourceforge.net/spec/dps-notes.txt).

We can have "readers" (what I'd called "input modes") that understand
the data source (e.g. "pysource" for Python source files, "pep" for
PEPs, one or more for standalone .rtxt files, "email" is possible,
etc.). Readers understand where the data is coming from, send discrete
"chunks" to the parser, and provide the context to bind the chunks
together into a cohesive whole. Readers also resolve all hyperlinks,
footnote numbers and links, interpreted text links, and anything else
that requires context-sensitive computation.

We have "parsers" for the syntax itself (just "reStructuredText" a.k.a.
"rst" a.k.a. "reST" a.k.a. "rtxt" for now). Parsers don't know or care
anything about the source or destination of the data; they just
analyze their input and produce conformant output.

I'm calling the next set of components "designers" (previously called
"syles"; "designers" is OK until a better term is found; "stylists"?
[#]_). Designers take the output from a reader and transform it.
Content transformations (moving stuff around, grouping, separating) as
well as cosmetic transformations (?) happen here. The output from a
designer is the input of the writer.

"Writers" (formerly "formatters") produce the final output (HTML, XML,
TeX, etc.). Writers merely do translations from one data format to
another; they don't do any content transformations. Their input may be
an augmented form of the current schema, with color and layout
information added.

It appears to me that there will be strong links between readers and
designers, whereas parsers and writers are more independent and
interchangeable.

Opinions? Comments?

.. [#] You may be able to tell that names for things are very
   important to me when designing a system. When all the pieces of the
   system have the right names, it feels right, and everything falls
   into place. I spend a lot of time searching for the right names. My
   thesaurus and dictionary are prominent in my technical library.

-- 
David Goodger    goodger@users.sourceforge.net    Open-source projects:
 - Python Docstring Processing System: http://docstring.sourceforge.net
 - reStructuredText: http://structuredtext.sourceforge.net
 - The Go Tools Project: http://gotools.sourceforge.net