summaryrefslogtreecommitdiff
path: root/sandbox/codeintro
diff options
context:
space:
mode:
authorjohnmulder <johnmulder@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-03-01 19:47:56 +0000
committerjohnmulder <johnmulder@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-03-01 19:47:56 +0000
commit3ab6ec991b046d55df1bbb6bf521092f66d28a01 (patch)
treeb8be69caec507c1882cc8f21869ac5b4a943c9a7 /sandbox/codeintro
parenta7b65714a945f8b823127b680fc01e82180b23f8 (diff)
downloaddocutils-3ab6ec991b046d55df1bbb6bf521092f66d28a01.tar.gz
Changed execution flow description to describe from the publisher level.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4977 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/codeintro')
-rw-r--r--sandbox/codeintro/codeintro.txt78
1 files changed, 53 insertions, 25 deletions
diff --git a/sandbox/codeintro/codeintro.txt b/sandbox/codeintro/codeintro.txt
index 71309fbe7..f3d95528a 100644
--- a/sandbox/codeintro/codeintro.txt
+++ b/sandbox/codeintro/codeintro.txt
@@ -34,29 +34,59 @@ on the docutils site in the `repository instructions`_.
Docutils Flow of Execution
==========================
The flow of a document through a docutils utility starts with a
-`Publisher` object from `docutils/core.py`. The publisher then
-calls the following:
-
-1. Reader in: `docutils/readers`
-
- a. Scan input text from file, string, or pre-proccessed document
- tree. Uses a subclass of `Input` in:
- `docutils/io.py`
- b. Parse text into document tree. The parser chosen depends on
- the document format of the input. Uses a parser in:
- `docutils/parsers/`
-
-2. Transformer in: `docutils/transforms/__init__.py`
- a. Apply transforms to the document tree as
- determined by the reader and writer. Uses transforms in:
- `docutils/transforms/`
+`Publisher` object from `docutils/core.py`. The publisher is used
+as follows:
+
+1. Instantiate the publisher, which in turn instantiates the
+ following:
+
+ a. The document tree (`docutils.nodes` objects).
+ b. A `docutils.readers.Reader` instance.
+ c. A `docutils.parsers.Parser` instance.
+ d. A `docutils.writers.Writer` instance.
+
+2. Set Components:
+
+ If reader, parser, or writer objects are not passed to
+ the publisher, check for names to have been passed in
+ and use them instead. If neither are passed in, use defualts.
+
+3. Process settings: ???
+
+4. Set Source:
+
+5. Set Destination
+
+6. Publish:
+
+ A. set io:???
+
+ B. Call the read function of the Reader
+
+ i. Scan input text from file, string, or pre-proccessed
+ document tree. Uses a subclass of `Input` in:
+ `docutils/io.py`
+ ii. Parse text into document tree. The parser chosen
+ depends on the document format of the input. Uses
+ a parser in:
+ `docutils/parsers/`
+ iii. Return a document tree to the Publisher. The tree
+ is made up of nodes from:
+ `docutils/nodes.py`
+
+ C. Call the apply transforms function of the Transformer
+ in: `docutils/transforms/__init__.py`
-3. Writer in: `docutils/writer`
+ Apply transforms to the document tree as determined by the
+ reader and writer. Uses transforms in:
+ `docutils/transforms/`
+
+ D. Call the write function of the Writer in: `docutils/writer`
- a. Takes document tree as input.
- b. Instanciates a subclass of `docutils.nodes.NodeVisitor` which
- traverses the doctree using the `Node.walkabout()` function in:
- `docutils/nodes/nodes.py`
+ a. Takes document tree as input.
+ b. Instantiates a subclass of `docutils.nodes.NodeVisitor` which
+ traverses the doctree using the `Node.walkabout()` function in:
+ `docutils/nodes/nodes.py`
Organization of the Docutils Code
=================================
@@ -173,10 +203,8 @@ to Docutils components. Tree transforms serve a variety of purposes:
transforms may be used to construct (for example) indexes and tables
of contents.
-Each transform is an optional step that a Docutils Reader may choose
-to perform on the parsed document, depending on the input context. A
-Docutils Reader may also perform Reader-specific transforms before or
-after performing these standard transforms.
+Each transform is an optional step that a Docutils component may
+choose to perform on the parsed document.
writers
-------