These are a collection of blocks for the PyMdown Extensions that I find useful.
This project is not affiliated with the PyMdown Extensions project and is currently in a very early stage. Currently, there is only one block: DirTree
.
pip install pymdownx-blocks
This can be used in MkDocs or by itself. To use in a Python file, we use the following:
import markdown
yaml_str=...
md=markdown.Markdown(extensions=['pymdownx_blocks.dirtree'])
To use in MkDocs, register the extension.
...
markdown_extensions:
...
- pymdownx_blocks.dirtree
...
In a markdown file,
///dirtree
root:
- subdir:
- File
- another subdir:
- anotherfile.txt
- file.csv
///
When rendered, this will produce the following tree
Directory Structure
root ├── subdir │ └── File └── another subdir ├── anotherfile.txt └── file.csv
More blocks are always welcome! This project uses rye for dependency management.
- Fork the repository
- Create a branch with the name of the block
- Implement the block
- Create a pull request.