@@ -53,7 +53,7 @@ Backwards-incompatible Changes
5353 all except the `text` argument on the `markdown.markdown()` wrapper function.
5454 Using positional arguments will raise a **`DeprecationWarning`** in 2.6 and an error
5555 in version 2.7. Only keyword arguments should be used. For example, if your code
56- previosuly looked like this:
56+ previously looked like this:
5757
5858 html = markdown.markdown(text, [SomeExtension()])
5959
@@ -65,11 +65,11 @@ Backwards-incompatible Changes
6565 This change is being made as a result of deprecating `"safe_mode"` as the
6666 `safe_mode` argument was one of the positional arguments. When that argument
6767 is removed, the two arguments following it will no longer be at the correct
68- position. It is recomended that you always use keywords when they are supported
68+ position. It is recommended that you always use keywords when they are supported
6969 for this reason.
7070
71- * In previous versions of Python-Markdown, the builtin extensions received
72- special status and did not require the full path to be provided. Additionaly ,
71+ * In previous versions of Python-Markdown, the built-in extensions received
72+ special status and did not require the full path to be provided. Additionally ,
7373 third party extensions whose name started with "mdx_" received the same
7474 special treatment. This behavior is deprecated and will raise a
7575 **`DeprecationWarning`** in version 2.6 and an error in 2.7. Ensure that you
@@ -86,15 +86,15 @@ Backwards-incompatible Changes
8686
8787 $ python -m markdown -x markdown.extensions.extra input.txt
8888
89- See the [documentation](reference.html#extensions) for a full explaination
89+ See the [documentation](reference.html#extensions) for a full explanation
9090 of the current behavior.
9191
9292* The previously documented method of appending the extension configs as
9393 a string to the extension name is deprecated and will raise a
9494 **`DeprecationWarning`** in version 2.6 and an error in 2.7.
9595 The [extension_configs](reference.html#extension_configs) keyword should
9696 be used instead. See the [documentation](reference.html#extension-configs)
97- for a full explaination of the current behavior.
97+ for a full explanation of the current behavior.
9898
9999* The [HeaderId][hid] Extension is pending deprecation and will raise a
100100 **`PendingDeprecationWarning`** in version 2.6. The extension will be
@@ -109,11 +109,59 @@ Backwards-incompatible Changes
109109
110110[hid]: extensions/header_id.html
111111
112+ * Positional arguments and the `configs` keyword on the `markdown.extension.Extension` class
113+ (and its subclasses) are deprecated. Each individual config option should be passed
114+ to the class as a keyword/value pair. For example. one might have previously initiated
115+ an extension subclass like this:
116+
117+ ext = SomeExtension(configs={'somekey': 'somevalue'})
118+
119+ That code should be updated to pass in the options directly:
120+
121+ ext = SomeExtension(somekey='somevalue')
122+
123+ Extension authors will want to note that this affects the `makeExtension` function as well.
124+ Previously it was common for the function to be defined as follows:
125+
126+ def makeExtension(configs=None):
127+ return SomeExtension(configs=configs)
128+
129+ Extension authors will want to update their code to the following instead:
130+
131+ def makeExtension(**kwargs):
132+ return SomeExtension(**kwargs)
133+
134+ Failing to do so will result in a DeprecationWarning and will raise an error in the next
135+ release. See the [Extension API][mext] documentation for more information.
136+
137+ In the event that an `markdown.extension.Extension` subclass overrides the `__init__` method
138+ and implements its own config handling, then the above may not apply. However, it is
139+ recommended that the subclass still calls the parent `__init__` method to handle configs
140+ like so:
141+
142+ class SomeExtension(markdown.extension.Extension):
143+ def __init__(**kwargs):
144+ # Do pre-config stuff here
145+ # Set config defaults
146+ self.config = {
147+ 'option1' : ['value1', 'description1'],
148+ 'option2' : ['value2', 'description2']
149+ }
150+ # Set user defined configs
151+ super(MyExtension, self).__init__(**kwargs)
152+ # Do post-config stuff here
153+
154+ Note the call to `super` to get the benefits of config handling from the parent class.
155+ See the [documentation][config] for more information.
156+
157+ [config]: extensions/api.html#configsettings
158+ [mext]: extensions/api.html#makeextension
159+
112160What's New in Python-Markdown 2.6
113161---------------------------------
114162
115163* Official support for [PyPy] has been added. While Python-Markdown has most likely
116- worked on PyPy for some time, it is now offically supported and tested on PyPy.
164+ worked on PyPy for some time, it is now officially supported and tested on PyPy.
117165
118166[PyPy]: http://pypy.org/
119167
@@ -129,7 +177,7 @@ worked on PyPy for some time, it is now offically supported and tested on PyPy.
129177[YAML]: http://yaml.org/
130178
131179* The [Table fo Contents][TOC] Extension has been refactored and some new features
132- have been added. See the documentation for a full explaination of each feature
180+ have been added. See the documentation for a full explanation of each feature
133181 listed below:
134182
135183 * The extension now assigns the Table of Contents to the `toc` attribute of
@@ -150,7 +198,7 @@ worked on PyPy for some time, it is now offically supported and tested on PyPy.
150198
151199 * A `baselevel` config option has been added allowing users to set the base level
152200 of headers in their documents (h1-h6). This allows the header levels to be
153- automatically adjusted to fit within the hierarchy of an html template.
201+ automatically adjusted to fit within the hierarchy of an HTML template.
154202
155203[TOC]: extensions/toc.html
156204
0 commit comments