From: AL <new...@al...> - 2012-04-21 22:24:21
|
Hi, I'd like to announce the release of a couple of extensions we've been working on since last year. I finally took time to release them today. They were developed in the context of [Active Archives](http://activearchives.org/), a research project about the practice of archiving in cultural institutions. Maybe they can benefit to the community... mdx_cite -------- An extension to support the <cite> tag - <http://git.constantvzw.org/?p=aa.mdx_cite.git;a=tree> - <https://github.com/aleray/mdx_cite> - <http://pypi.python.org/pypi/mdx_cite/1.0> >>> import markdown >>> src = '"""Who Is Killing the Great Chefs of Europe?""" is the last movie I watched.' >>> html = markdown.markdown(src, ['cite']) >>> print(html) <p><cite>Who Is Killing the Great Chefs of Europe?</cite> is the last movie I watched.</p> mdx_del_ins ----------- An extension to support the <del> and <ins> tags - <http://git.constantvzw.org/?p=aa.mdx_del_ins.git;a=tree> - <https://github.com/aleray/mdx_del_ins> - <http://pypi.python.org/pypi/mdx_del_ins/1.0> >>> import markdown >>> src = """This is ++added content++ and this is ~~deleted content~~""" >>> html = markdown.markdown(src, ['del_ins']) >>> print(html) <p>This is <ins>added content</ins> and this is <del>deleted content</del> </p> mdx_outline ----------- An extension to wrap the document logical sections (as implied by h1-h6 headings) - <http://git.constantvzw.org/?p=aa.mdx_outline.git;a=tree> - <https://github.com/aleray/mdx_outline> - <http://pypi.python.org/pypi/mdx_outline/1.0> This is a rewrite of the mdx_addsection extension we've written for active archives. The first version had a bug with non hierachical heading structures. This is no longer a problem: a couple of weeks ago, Jesse Dhillon pushed to github a similar plugin which fixes the problem. Thanks to him, mdx_outline no longer has the problem. >>> import markdown >>> src = """ ... # 1 ... Section 1 ... ## 1.1 ... Subsection 1.1 ... ## 1.2 ... Subsection 1.2 ... ### 1.2.1 ... Hey 1.2.1 Special section ... ### 1.2.2 ... #### 1.2.2.1 ... # 2 ... Section 2 ... """.strip() >>> html = markdown.markdown(src, ['sections']) >>> print(html) <section class="section1"><h1>1</h1> <p>Section 1</p> <section class="section2"><h2>1.1</h2> <p>Subsection 1.1</p> </section><section class="section2"><h2>1.2</h2> <p>Subsection 1.2</p> <section class="section3"><h3>1.2.1</h3> <p>Hey 1.2.1 Special section</p> </section><section class="section3"><h3>1.2.2</h3> <section class="section4"><h4>1.2.2.1</h4> </section></section></section></section><section class="section1"><h1>2</h1> <p>Section 2</p> </section> mdx_semanticdata ---------------- An extension to add support for semantic data (RDFa). - <http://git.constantvzw.org/?p=aa.mdx_semanticdata.git;a=tree> - <https://github.com/aleray/mdx_semanticdata> - <http://pypi.python.org/pypi/mdx_semanticdata/1.0> >>> import markdown >>> text = "%%dc:author :: Sherry Turkle | Turkle's%% %%dc:title::Second Self%% was an early book on the social aspects of computation." >>> html = markdown.markdown(text, ['semanticdata']) >>> print(html) <p><span content="Sherry Turkle" property="dc:author">Turkle's</span> <span content="Second Self" property="dc:title">Second Self</span> was an early book on the social aspects of computation.</p> mdx_semanticwikilinks --------------------- An extension to add support for semantic (wiki)links (RDFa). - <http://git.constantvzw.org/?p=aa.mdx_semanticwikilinks.git;a=tree> - <https://github.com/aleray/mdx_semanticwikilinks> - <http://pypi.python.org/pypi/mdx_semanticwikilinks/1.0> >>> md = markdown.Markdown(extensions=['semanticwikilinks'], ... extension_configs={'semanticwikilinks' : [('namespace', 'mynamespace')]}) >>> html = md.convert('[[ Speaker :: Sherry Turkle | Second Self ]]') >>> print(html) <p><a href="Sherry Turkle" rel="mynamespace:Speaker">Second Self</a></p> All the best, -- Alex |