diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/command_line.txt | 2 | ||||
-rw-r--r-- | docs/using_as_module.txt | 10 | ||||
-rw-r--r-- | docs/writing_extensions.txt | 24 |
3 files changed, 18 insertions, 18 deletions
diff --git a/docs/command_line.txt b/docs/command_line.txt index a357a54..a6929b5 100644 --- a/docs/command_line.txt +++ b/docs/command_line.txt @@ -36,7 +36,7 @@ path. * **Linux**: - As each Linux distribution is different and we can't possible document all + As each Linux distribution is different and we can't possibly document all of them here, we'll provide a few helpful pointers: * Some systems will automatically install the script on your path. Try it diff --git a/docs/using_as_module.txt b/docs/using_as_module.txt index da6b1fd..cfeb88d 100644 --- a/docs/using_as_module.txt +++ b/docs/using_as_module.txt @@ -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="uft8") + md.convertFile(input="in.txt", output="out.html", encoding="utf8") The markdown module also includes a shortcut function ``markdownFromFile`` that wraps the above method. @@ -112,9 +112,9 @@ still create links using Markdown syntax.) markdown.HTML_REMOVED_TEXT = "--RAW HTML IS NOT ALLOWED--" md = markdown.Markdown(safe_mode="replace") - **Note**: You may edit the value of ``HTML_REMOVED_TEXT`` directly in - markdown.py but you will need to remember to do so every time you upgrade - to a newer version of Markdown. + **Note**: You could edit the value of ``HTML_REMOVED_TEXT`` directly in + markdown/__init__.py but you will need to remember to do so every time you + upgrade to a newer version of Markdown. Therefore, this is not recommended. * To remove HTML, set ``safe_mode="remove"``. Any raw HTML will be completely stripped from the text with no warning to the author. @@ -127,7 +127,7 @@ Output Formats If Markdown is outputing (X)HTML as part of a web page, most likely you will want the output to match the (X)HTML version used by the rest of your page/site. -Currenlty, Markdown offers two output formats out of the box; "HTML4" and +Currently, Markdown offers two output formats out of the box; "HTML4" and "XHTML1" (the default) . Markdown will also accept the formats "HTML" and "XHTML" which currently map to "HTML4" and "XHTML" respectively. However, you should use the more explicit keys as the general keys may change in the diff --git a/docs/writing_extensions.txt b/docs/writing_extensions.txt index 77c6bde..860c2ec 100644 --- a/docs/writing_extensions.txt +++ b/docs/writing_extensions.txt @@ -132,10 +132,10 @@ situation. Treeprocessors manipulate an ElemenTree object after it has passed through the core BlockParser. This is where additional manipulation of the tree takes -place. Additionaly, the InlineProcessor is a Treeprocessor which steps through +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. -An Treeprocessor should inherit from ``markdown.Treeprocessor``, +A 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. @@ -143,7 +143,7 @@ A pseudo example: class MyTreeprocessor(markdown.Treeprocessor): def run(self, root): - #do stufff + #do stuff return my_modified_root For specifics on manipulating the ElementTree, see @@ -208,7 +208,7 @@ The **``run``** method takes two arguments: method must remove (pop) the first block from the list (which it altered in place - not returned) and parse that block. You may find that a block of text legitimately contains multiple block types. Therefore, after processing the - first type, you processor can insert the remaining text into the beginning + first type, your processor can insert the remaining text into the beginning of the ``blocks`` list for future parsing. Please be aware that a single block can span multiple text blocks. For example, @@ -233,11 +233,11 @@ Each BlockProcessor has the following utility methods available: Removes one level of indent (four spaces by default) from the front of each line of the given text string. -* **``looseDetab(text)``**: +* **``looseDetab(text, level)``**: - Removes one level if indent from the front of each line of the given text - string. However, this methods allows secondary lines to not be indented as - does some parts of the Markdown syntax. + Removes "level" levels of indent (defaults to 1) from the front of each line + of the given text string. However, this methods allows secondary lines to + not be indented as does some parts of the Markdown syntax. Each BlockProcessor also has a pointer to the containing BlockParser instance at ``self.parser``, which can be used to check or alter the state of the parser. @@ -404,7 +404,7 @@ into the markdown pipeline. Consider yourself warned. A simple example: - class MyExtension(makrdown.Extension): + class MyExtension(markdown.Extension): def extendMarkdown(self, md, md_globals): # Insert instance of 'mypattern' before 'references' pattern md.inlinePatterns.add('mypattern', MyPattern(md), '<references') @@ -473,7 +473,7 @@ Now let's insert another item. Note that we also could have set the location of "twohalf" to be 'after two' (i.e.: ``'>two'``). However, it's unlikely that you will have control over the order in which extensions will be loaded, and this could affect the final -sorted order of an OrderedDict. For example, suppose a extension adding +sorted order of an OrderedDict. For example, suppose an extension adding 'twohalf' in the above examples was loaded before a separate extension which adds 'two'. You may need to take this into consideration when adding your extension components to the various markdown OrderedDicts. @@ -563,8 +563,8 @@ the module and call the ``makeExtension`` function initiating your extension. You may have noted that the extensions packaged with Python-Markdown do not use the ``mdx_`` prefix in their module names. This is because they are all -part of the ``markdown_extensions`` package. Markdown will first try to import -from ``markdown_extensions.extname`` and upon failure, ``mdx_extname``. If both +part of the ``markdown.extensions`` package. Markdown will first try to import +from ``markdown.extensions.extname`` and upon failure, ``mdx_extname``. If both fail, Markdown will continue without the extension. However, Markdown will also accept an already existing instance of an extension. |