|
From: Waylan L. <wa...@gm...> - 2008-02-21 21:29:48
|
On Thu, Feb 21, 2008 at 3:58 PM, David Wolever <wo...@cs...> wrote:
> On 21-Feb-08, at 3:34 PM, Waylan Limberg wrote:
> > On Thu, Feb 21, 2008 at 2:33 PM, David Wolever
> > <wo...@cs...> wrote:
> >> At the moment, a list extension names is passed to Markdown(), and
> >> the Markdown class is responsible for loading them.
> >> This makes it harder to pragmatically load extensions.
> > Harder in what way?
> At the moment, you've got to put your extension in a module called
> mdx_eggs.
Ok, so your trying to remove the requirement that each extension has
to be in it's own file. I supose this would make a few things easier.
> >> I have written a patch (attached) so that a list of extension
> >> modules
> >> will be passed to Markdown().
> > One concern I have it that, unless I missed it, you have completely
> > removed the `extension_configs` arg. You only allow key=value pairs
> > separated by commas. The `extension_configs` arg makes it possible to
> > easily set configs programicly or even pass in complex python data
> > structures.
> The assumption, which I guess I didn't make clear, what that the
> extensions passed to Markdown were "ready to go" -- they are just
> waiting for a call to extendMarkdown().
>
> So, if you were to be using the abbreviation extension, the code
> would look something like this:
> abbr = __import__("abbr")
> abbr = abbr.makeExtension(("abbrs", (("RAM", "random access memory"),
> ("SSH", "secure shell"))))
> Markdown(extensions = [abbr]).convert("I use SSH to check my free RAM")
>
> Alternately, the load_extension function could be modified to take a
> "config" parameter...
I would prefer to see the config parameter. There are people who will
only ever use the extensions with no need to understand how they work.
Seeing we offered a arg before, lets keep it, or something similar, if
we can.
--
----
Waylan Limberg
wa...@gm...
|