From: Waylan L. <wa...@gm...> - 2013-09-05 00:08:53
|
Fred, The answer is all explained in the [docs] under 'makeExtension'. The order of the options listed there is the prefered order: 1. import and pass an instance to Markdown 2. pass a string using dot notion 3. pass a name for extensions in the 'markdown.extensions' namespace 4. use mdx_* As you noted, #4 is discouraged and may go away in the near future. #3 is reserved for extensions bundled with the markdown library only. So that leaves you with #1 and/or #2. I would like to eliminate #2 as well, but then we cut off extension access on the command line. The point is, extension users should be told to import the extension and pass an instance to markdown -- with dot notation as a fallback. So when picking a name think about what works best in this line of Python: ```python from mymodule import MyExtClass ``` [docs]: http://pythonhosted.org/Markdown/extensions/api.html#makeextension ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg On Wed, Sep 4, 2013 at 3:18 AM, Frederik Dohr <fd...@gm...> wrote: > Hi all, > > Recently I've written an extension for GitHub-style checklists: > https://github.com/FND/markdown-checklist > > I wasn't quite sure how best to name/package that extension though, > ultimately settling on "markdown_checklist.extension". > > A friendly contributor suggested to use "mdx_checklist" instead: > https://github.com/FND/markdown-checklist/pull/3 > I understand that method is outdated though? (See my comment there.) > > The source (`markdown:build_extension`) suggests that I should move my > extension into the `markdown.extensions` namespace. However, I'm not > convinced that's correct for third-party extensions, nor am I entirely > certain how best to do that (though I'm familiar with shared virtual > namespaces). Notably, the third-party extensions I looked at all seem to > use the "old-style" mdx_* scheme. > > Any guidance would be much appreciated! > > > Thanks, > > Fred > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss |