Skip to content

A Python Markdown extension to add inline block elements based on PyMdown Extensions.

Notifications You must be signed in to change notification settings

joapuiib/pymdownx-inline-blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMdown Inline Blocks

A Python Markdown extension to convert inline block shorthand syntax into PyMdown Block Extension format

  • Convert single-line inline block syntax into fully-formed block syntax.
  • Supports modifiers for advanced block formatting.
  • Simple and lightweight; integrates easily with Markdown or MkDocs.

Example

The following markdown inline block syntax:

![img](placeholder.png)
/// attribution: Unknown author
/// figure-caption | < ^1 : Caption

Will be converted to the following PyMdown Block syntax:

![img](placeholder.png)
/// attribution
Unknown author
///
/// figure-caption | < ^1
Caption
///

Installation

Install the extension via pip:

pip install pymdownx-inline-blocks

Usage

To use the extension, add it to your Markdown or MkDocs configuration:

md = markdown.Markdown(extensions=['inline_blocks'])

or, if using MkDocs, add it to your mkdocs.yml:

markdown_extensions:
  - inline_blocks

Options

The extension supports the following options:

  • exclude_blocks: A list of block types to exclude from processing. Default is ['html'].
  • delimiter: The delimiter used to separate the block and the content. Default is :.

About

A Python Markdown extension to add inline block elements based on PyMdown Extensions.

Topics

Resources

Stars

Watchers

Forks

Languages