aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2014-04-20 17:03:42 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2014-04-20 17:03:42 -0400
commita24cfba970406be2a46832a567a8b234448aeaa6 (patch)
tree991967f767a7a089a135a822f9eb322804b9086c /docs
parent51713a10e3de1cbf0b29936d81dc061a9f73b819 (diff)
parent9a2211a0447f8b3e019e47ca23b4648f9c321258 (diff)
downloadmarkdown-a24cfba970406be2a46832a567a8b234448aeaa6.tar.gz
markdown-a24cfba970406be2a46832a567a8b234448aeaa6.tar.bz2
markdown-a24cfba970406be2a46832a567a8b234448aeaa6.zip
Merge pull request #306 from brownhead/master
Emphasized proper use of reset method in docs.
Diffstat (limited to 'docs')
-rw-r--r--docs/reference.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/reference.txt b/docs/reference.txt
index b627c46..5a7490a 100644
--- a/docs/reference.txt
+++ b/docs/reference.txt
@@ -25,10 +25,11 @@ The Details
Python-Markdown provides two public functions ([`markdown.markdown`](#markdown)
and [`markdown.markdownFromFile`](#markdownFromFile)) both of which wrap the
public class [`markdown.Markdown`](#Markdown). If you're processing one
-document at a time, the functions will serve your needs. However, if you need
+document at a time, these functions will serve your needs. However, if you need
to process multiple documents, it may be advantageous to create a single
instance of the `markdown.Markdown` class and pass multiple documents through
-it.
+it. If you do use a single instance though, make sure to call the `reset`
+method appropriately ([see below](#convert)).
### `markdown.markdown (text [, **kwargs])` {: #markdown }
@@ -282,17 +283,19 @@ string must be passed to one of two instance methods:
html1 = md.convert(text1)
html2 = md.convert(text2)
- Note that depending on which options and/or extensions are being used,
- the parser may need its state reset between each call to `convert`.
+ Depending on which options and/or extensions are being used, the parser may
+ need its state reset between each call to `convert`, otherwise performance
+ can degrade drastically:
html1 = md.convert(text1)
md.reset()
html2 = md.convert(text2)
- You can also chain calls to `reset` together:
+ To make this easier, you can also chain calls to `reset` together:
html3 = md.reset().convert(text3)
+
* `Markdown.convertFile(**kwargs)`{: #convertFile }
The arguments of this method are identical to the arguments of the same