From 15224bd352bc6c06ae05ffd78d5ecee9ea07f6ef Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sun, 19 Oct 2008 22:30:03 -0400 Subject: Changed Postprocessors to Treeprocessors and TextPostProcessors to Postprocessors. These names more acturately depict what things do. Also updated the extensions and docs to match. --- docs/writing_extensions.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'docs') 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][]. -

ElementTree Postprocessors

+

Treeprocessors

-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. -

TextPostprocessors

+

Postprocessors

-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 -- cgit v1.2.3