Package: denden-extension
denden_extensionDenden_extension is aPython-Markdownextension enablesDenDenMarkdownsyntax in Python-Markdown.RequirementPython-Markdown >= 3.0.0, < 3.1Installpip install denden_extensionUsageDesignate denden_extension as extension with other extensions when you use the Python-Markdown.>>> import markdown
>>> from denden_extension import DenDenExtension
>>> markdown_text = '{電子出版|でんししゅっぱん}を手軽に'
>>> html_text = markdown.markdown(markdown_text, extensions=['markdown.extensions.extra', 'markdown.extensions.nl2br', 'markdown.extensions.sane_lists', DenDenExtension()])
>>> html_text
'<p><ruby>電子出版<rt>でんししゅっぱん</rt></ruby>を手軽に</p>'or>>> import markdown
>>> from denden_extension import DenDenExtension
>>> markdown.markdownFromFile(
...             input='markdown_text.md',
...             output='html_text.html',
...             encoding='utf-8',
...             extensions=['markdown.extensions.extra', 'markdown.extensions.nl2br', 'markdown.extensions.sane_lists', DenDenExtension()],
...             )orpython -m markdown -x markdown.extensions.extra -x markdown.extensions.nl2br -x markdown.extensions.sane_lists -x denden_extension markdown_text.md > html_text.htmlFor more details of usage of Python-Markdown, seePython-Markdown documentation.OptionsYou can disable some features of denden_extension.Disable Chunk file syntax:>>> html_text = markdown.markdown(markdown_text, extensions=['markdown.extensions.extra', 'markdown.extensions.nl2br', 'markdown.extensions.sane_lists', DenDenExtension(docbreak=False)])Disable Footnotes with epub:type attribute:>>> html_text = markdown.markdown(markdown_text, extensions=['markdown.extensions.extra', 'markdown.extensions.nl2br', 'markdown.extensions.sane_lists', DenDenExtension(footnote=False)])If you run the Python-Markdown from command line with an extension with options, you need to prepare the configuration file. For more details, seePython-Markdown documentation.DescriptionDenDenMarkdown is an extended Markdown syntax fitted for Japanese and EPUB publishing.Denden_extension enables the following DenDenMarkdown syntax in Python-Markdown.Japanese Ruby AnnotationTate-Chu-YokoFootnotes with epub:type attribute*1EPUB pagebreak syntaxChunk file syntax*2*1 Denden_extension depends on the Python-Markdown's footnotes extension for implementing this feature. So you also need themarkdown.extensions.footnotesormarkdown.extensions.extrawhich includes the footnotes extension.*2 Three or more equal signs ('=') on a line by themselves is replaced by a horizontal rule tag with docbreak class attribute (<hr class="docbreak" />).DenDenMarkdown inherits its syntax fromPHP Markdown Extra. In Python-Markdown, PHP Markdown Extra syntax is enabled bymarkdown.extensions.extraandmarkdown.extensions.sane_lists, which are included in the Python-Markdown Library.Also, DenDenMarkdown adopts GFM style line break. This can be enabled bymarkdown.extensions.nl2br, which is included with the Python-Markdown too.If you only want to use DenDenMarkdown's original syntax, you just need to designate only markdown.extensions.footnotes and denden_extension.If you don't use footnotes, only denden_extension is necessary.The following syntax of DenDenMarkdown is not implemented in denden_extension.Twitter account autolink syntaxFor more details of DenDenMarkdown syntax, seehttp://conv.denshochan.com/markdown(Japanese).Change log2.0 (2020-12-21) -- suport only Python-Markdown >= 3.0.0, < 3.1 and Python31.0 (2016-04-29) -- formal release0.1 (2015-08-23) -- first experimental releaseContactContact form