diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/AUTHORS | 1 | ||||
-rw-r--r-- | docs/CHANGE_LOG | 6 | ||||
-rw-r--r-- | docs/release-2.0.2.txt | 9 | ||||
-rw-r--r-- | docs/using_as_module.txt | 8 | ||||
-rw-r--r-- | docs/writing_extensions.txt | 36 |
5 files changed, 38 insertions, 22 deletions
diff --git a/docs/AUTHORS b/docs/AUTHORS index cfe2b34..2843b56 100644 --- a/docs/AUTHORS +++ b/docs/AUTHORS @@ -37,6 +37,7 @@ Daniel Krech Steward Midwinter Jack Miller Neale Pickett +Paul Stansifer John Szakmeister Malcolm Tredinnick Ben Wilson diff --git a/docs/CHANGE_LOG b/docs/CHANGE_LOG index 1b4af45..e005ff8 100644 --- a/docs/CHANGE_LOG +++ b/docs/CHANGE_LOG @@ -1,6 +1,12 @@ PYTHON MARKDOWN CHANGELOG ========================= +Sept 28, 2009: Released version 2.0.2-Final. + +May 20, 2009: Released version 2.0.1-Final. + +Mar 30, 2009: Released version 2.0-Final. + Mar 8, 2009: Release Candidate 2.0-rc-1. Feb 2009: Added support for multi-level lists to new Blockprocessors. diff --git a/docs/release-2.0.2.txt b/docs/release-2.0.2.txt new file mode 100644 index 0000000..8ae9a3d --- /dev/null +++ b/docs/release-2.0.2.txt @@ -0,0 +1,9 @@ +Python-Markdown 2.0.2 Release Notes +=================================== + +Python-Markdown 2.0.2 is a bug-fix release. No new features have been added. +Most notably, the setup script has been updated to include a dependency on +ElementTree on older versions of Python (< 2.5). There have also been a few +fixes for minor parsing bugs in some edge cases. For a full list of changes, +see the git log. + diff --git a/docs/using_as_module.txt b/docs/using_as_module.txt index cfeb88d..130d0a7 100644 --- a/docs/using_as_module.txt +++ b/docs/using_as_module.txt @@ -20,13 +20,13 @@ string should work) and returns output as Unicode. Do not pass encoded strings If your input is encoded, e.g. as UTF-8, it is your responsibility to decode it. E.g.: - input_file = codecs.open("some_file.txt", mode="r", encoding="utf8") + input_file = codecs.open("some_file.txt", mode="r", encoding="utf-8") text = input_file.read() html = markdown.markdown(text, extensions) If you later want to write it to disk, you should encode it yourself: - output_file = codecs.open("some_file.html", "w", encoding="utf8") + output_file = codecs.open("some_file.html", "w", encoding="utf-8") output_file.write(html) More Options @@ -61,7 +61,7 @@ The ``Markdown`` class has the method ``convertFile`` which reads in a file and writes out to a file-like-object: md = markdown.Markdown() - md.convertFile(input="in.txt", output="out.html", encoding="utf8") + md.convertFile(input="in.txt", output="out.html", encoding="utf-8") The markdown module also includes a shortcut function ``markdownFromFile`` that wraps the above method. @@ -69,7 +69,7 @@ wraps the above method. markdown.markdownFromFile(input="in.txt", output="out.html", extensions=[], - encoding="utf8", + encoding="utf-8", safe=False) In either case, if the ``output`` keyword is passed a file name (i.e.: diff --git a/docs/writing_extensions.txt b/docs/writing_extensions.txt index 860c2ec..3aad74a 100644 --- a/docs/writing_extensions.txt +++ b/docs/writing_extensions.txt @@ -38,15 +38,15 @@ Preprocessors munge the source text before it is passed into the Markdown core. This is an excellent place to clean up bad syntax, extract things the parser may otherwise choke on and perhaps even store it for later retrieval. -Preprocessors should inherit from ``markdown.Preprocessor`` and implement -a ``run`` method with one argument ``lines``. The ``run`` method of each -Preprocessor will be passed the entire source text as a list of Unicode strings. -Each string will contain one line of text. The ``run`` method should return -either that list, or an altered list of Unicode strings. +Preprocessors should inherit from ``markdown.preprocessors.Preprocessor`` and +implement a ``run`` method with one argument ``lines``. The ``run`` method of +each Preprocessor will be passed the entire source text as a list of Unicode +strings. Each string will contain one line of text. The ``run`` method should +return either that list, or an altered list of Unicode strings. A pseudo example: - class MyPreprocessor(markdown.Preprocessor): + class MyPreprocessor(markdown.preprocessors.Preprocessor): def run(self, lines): new_lines = [] for line in lines: @@ -61,9 +61,9 @@ A pseudo example: Inline Patterns implement the inline HTML element syntax for Markdown such as ``*emphasis*`` or ``[links](http://example.com)``. Pattern objects should be -instances of classes that inherit from ``markdown.Pattern`` or one of its -children. Each pattern object uses a single regular expression and must have -the following methods: +instances of classes that inherit from ``markdown.inlinepatterns.Pattern`` or +one of its children. Each pattern object uses a single regular expression and +must have the following methods: * **``getCompiledRegExp()``**: @@ -84,7 +84,7 @@ match everything before the pattern. For an example, consider this simplified emphasis pattern: - class EmphasisPattern(markdown.Pattern): + class EmphasisPattern(markdown.inlinepatterns.Pattern): def handleMatch(self, m): el = markdown.etree.Element('em') el.text = m.group(3) @@ -135,13 +135,13 @@ core BlockParser. This is where additional manipulation of the tree takes place. Additionally, the InlineProcessor is a Treeprocessor which steps through the tree and runs the InlinePatterns on the text of each Element in the tree. -A Treeprocessor should inherit from ``markdown.Treeprocessor``, +A Treeprocessor should inherit from ``markdown.treeprocessors.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 MyTreeprocessor(markdown.Treeprocessor): + class MyTreeprocessor(markdown.treeprocessors.Treeprocessor): def run(self, root): #do stuff return my_modified_root @@ -155,15 +155,15 @@ Postprocessors manipulate the document after the ElementTree has been serialized into a string. Postprocessors should be used to work with the text just before output. -A Postprocessor should inherit from ``markdown.Postprocessor`` and -over-ride the ``run`` method which takes one argument ``text`` and returns a -Unicode string. +A Postprocessor should inherit from ``markdown.postprocessors.Postprocessor`` +and over-ride the ``run`` method which takes one argument ``text`` and returns +a Unicode string. 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 TocPostprocessor(markdown.Postprocessor): + class TocPostprocessor(markdown.postprocessors.Postprocessor): def run(self, text): return MYMARKERRE.sub(MyToc, text) @@ -179,8 +179,8 @@ That Blockprocessor parses the block and adds it to the ElementTree. The [[Definition Lists]] extension would be a good example of an extension that adds/modifies Blockprocessors. -A Blockprocessor should inherit from ``markdown.BlockProcessor`` and implement -both the ``test`` and ``run`` methods. +A Blockprocessor should inherit from ``markdown.blockprocessors.BlockProcessor`` +and implement both the ``test`` and ``run`` methods. The ``test`` method is used by BlockParser to identify the type of block. Therefore the ``test`` method must return a boolean value. If the test returns |