aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Sullivan <johnsullivan@khanacademy.org>2014-04-19 11:36:44 -0700
committerJohn Sullivan <johnsullivan@khanacademy.org>2014-04-19 11:36:44 -0700
commit9a2211a0447f8b3e019e47ca23b4648f9c321258 (patch)
tree991967f767a7a089a135a822f9eb322804b9086c
parent51713a10e3de1cbf0b29936d81dc061a9f73b819 (diff)
downloadmarkdown-9a2211a0447f8b3e019e47ca23b4648f9c321258.tar.gz
markdown-9a2211a0447f8b3e019e47ca23b4648f9c321258.tar.bz2
markdown-9a2211a0447f8b3e019e47ca23b4648f9c321258.zip
Emphasized proper use of reset method in docs.
This is related to waylan/Python-Markdown#305.
-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