From: Waylan L. <wa...@gm...> - 2011-06-29 16:51:12
|
On Wed, Jun 29, 2011 at 12:00 PM, Marco Pantaleoni <mar...@gm...> wrote: > On Wed, Jun 29, 2011 at 5:28 PM, Waylan Limberg <wa...@gm...> wrote: >> >> As a side note. I've found that users tend to get confused by (and >> therefore avoid using) extension configs. It is easy to add another >> extension. Not so easy to change config settings for one though. In >> other words, the typical user would rather do: >> >> markdown.markdown(text, extensions=['attr_list', 'headerid']) >> >> rather than: >> >> markdown.markdown(text, extensions=['attr_list(forceid=True)']) >> Keep in mind that the above syntax is only available because that's how the comandline script takes ext configs. It just so happens that the code that parses that is contained in the Markdown class. It is really a coincidence that it works at all. However, as many people have been using it, I'm not going to disable that feature. > > What about > > markdown.markdown(text, extensions=[('attr_list', {'forceid': True}), ...]) > This is already possible through the extension_config keyword on either the class or the wrapper function (IIRC support for this on the function is a recent addition). Yes that means you have to list the extension twice (extensions and configs), but that was the API before I came to the project. We've made too many other API changes in the past, so it is staying. I'm certainly not creating a third way. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |