--- title: How to extend Markdown with custom blocks date: "2021-01-08T09:37:48Z" lastmod: "2021-01-08T09:37:52Z" categories: - coding wp_id: 3059 description: I use the markdown-customblocks library to extend Python Markdown for complex layouts. This allows me to create nested Bootstrap columns and custom tags, like audio players, directly within Markdown files without writing raw HTML code. keywords: [markdown-customblocks, python-markdown, bootstrap grid, custom blocks, markdown extension, html generation] --- One problem I've had in Markdown is rendering a content in columns. On Bootstrap, the markup would look like this: ```markup
This is some content
`. But I can't do that to multiple paragraphs. Nor can I next content, i.e. add a `.col` inside the `.row`. Enter [markdown-customblocks](https://pypi.org/project/markdown-customblocks/). It's a Python module that extends [Python Markdown](https://python-markdown.github.io/). This lets me write: ```markdown ::: row ::: col Content in column 1 ::: col Content in column 2 ::: row ::: col Content in column 1 ::: col Content in column 2 ``` This translates to: ```markup