aboutsummaryrefslogtreecommitdiffstats
path: root/docs/writing_extensions.txt
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-10-19 22:30:03 -0400
committerWaylan Limberg <waylan@gmail.com>2008-10-19 22:30:03 -0400
commit15224bd352bc6c06ae05ffd78d5ecee9ea07f6ef (patch)
treefb762121f0529a15fe09dc831f3dc75d269b30d4 /docs/writing_extensions.txt
parentc6e6f944773ee7ee2926b43dda4cdabd6f9a5058 (diff)
downloadmarkdown-15224bd352bc6c06ae05ffd78d5ecee9ea07f6ef.tar.gz
markdown-15224bd352bc6c06ae05ffd78d5ecee9ea07f6ef.tar.bz2
markdown-15224bd352bc6c06ae05ffd78d5ecee9ea07f6ef.zip
Changed Postprocessors to Treeprocessors and TextPostProcessors to Postprocessors. These names more acturately depict what things do. Also updated the extensions and docs to match.
Diffstat (limited to 'docs/writing_extensions.txt')
-rwxr-xr-xdocs/writing_extensions.txt26
1 files changed, 12 insertions, 14 deletions
diff --git a/docs/writing_extensions.txt b/docs/writing_extensions.txt
index 734bf84..a97dfdb 100755
--- a/docs/writing_extensions.txt
+++ b/docs/writing_extensions.txt
@@ -22,9 +22,8 @@ features documented here.
* [TextPreprocessors][]
* [Line Preprocessors][]
* [InlinePatterns][]
-* [Postprocessors][]
- * [ElementTree Postprocessors][]
- * [TextProstprocessors][]
+* [Treeprocessors][]
+* [Prostprocessors][]
* [MarkdownParser][]
* [Working with the ElementTree][]
* [Integrating your code into Markdown][]
@@ -157,15 +156,15 @@ a table of contents, or raw html.
There are two types of postprocessors: [ElementTree Postprocessors][] and
[TextPostprocessors][].
-<h4 id="etpostprocessors">ElementTree Postprocessors</h4>
+<h3 id="treeprocessors">Treeprocessors</h3>
-An ElementTree Postprocessor should inherit from ``markdown.Postprocessor``,
-over-ride the ``run`` method which takes one argument ``root`` and returns
-either that root element or a modified root element.
+An Treeprocessor should inherit from ``markdown.Treeprocessor``,
+over-ride the ``run`` method which takes one argument ``root`` (an Elementree
+object) and returns either that root element or a modified root element.
A pseudo example:
- class MyPostprocessor(markdown.Postprocessor):
+ class MyTreeprocessor(markdown.Treeprocessor):
def run(self, root):
#do stufff
return my_modified_root
@@ -173,17 +172,17 @@ A pseudo example:
For specifics on manipulating the ElementTree, see
[Working with the ElementTree][] below.
-<h4 id="textpostprocessors">TextPostprocessors</h4>
+<h3 id="postprocessors">Postprocessors</h3>
-A TextPostprocessor should inherit from ``markdown.TextPostprocessor`` and
+A Postprocessor should inherit from ``markdown.Postprocessor`` and
over-ride the ``run`` method which takes one argument ``text`` and returns a
Unicode string.
-TextPostprocessors are run after the ElementTree has been serialized back into
+Postprocessors are run after the ElementTree has been serialized back into
Unicode text. For example, this may be an appropriate place to add a table of
contents to a document:
- class TocTextPostprocessor(markdown.TextPostprocessor):
+ class TocPostprocessor(markdown.Postprocessor):
def run(self, text):
return MYMARKERRE.sub(MyToc, text)
@@ -461,9 +460,8 @@ than one residing in a module.
[TextPreprocessors]: #textpreprocessors
[Line Preprocessors]: #linepreprocessors
[InlinePatterns]: #inlinepatterns
+[Treeprocessors]: #treeprocessors
[Postprocessors]: #postprocessors
-[ElementTree Postprocessors]: #etpostprocessors
-[TextProstprocessors]: #textpostprocessors
[MarkdownParser]: #markdownparser
[Working with the ElementTree]: #working_with_et
[Integrating your code into Markdown]: #integrating_into_markdown