{"repo":"vokimon/markdown-customblocks","free":true,"listed":false,"github":"https://github.com/vokimon/markdown-customblocks","clone":"git clone https://github.com/vokimon/markdown-customblocks.git","description":"Markdown extension to easily define custom blocks","language":"Python","stars":38,"topics":["markdown","markdown-extension","youtube","twitter","figures","admonition","instagram","mastodon","openstreetmap","peertube"],"license":"AGPL-3.0","category":"deployment-docker-iac","readme_excerpt":"Customblocks for Markdown Customblocks is an extension for [Python-Markdown] that settles a common markup for parametrizable and nestable components whose output can be redefined by means of a simple Python function. Many off-the-shelf components are provided such as div-containers, admonitions, figures, link cards, maps... and some embeded widgets from common sites (wikipedia, youtube, vimeo, peertube, mastodon, twitter, facebook, instagram, goteo, verkami...) It also includes convenience tools to ease component definition: hyperscript html generation, cached page fetching and metadata page extraction. [Python-Markdown]: https://python-markdown.github.io/ Installation and setup To install: And then activate it as any other Markdown extension. From command line: In Python code: In Pelican config: For MkDocs, add this to mkdocs.yml : If you need to specify additional parameters for the extension, refer to the documentation of your generator. Basic usage Customblocks extension parses markup structures like this one: And, by default, generates HTML like this: This is the output of the default generator: container . But we could bound mytype to a custom Python function like the following one: And then, previous Markdown would generate this other HTML: Notice that this function is not escaping any received value and is not converting anything in the content to Markdown. Luckily, customblocks provides some useful tools for that: the hyperscript generator and the Markdown subparser:","default_branch":null,"files":null,"tree":[],"storefront":"/r/vokimon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vokimon/markdown-customblocks/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}