Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tillerburr/pymdownx-blocks
Custom Blocks for PyMdown Extensions
https://github.com/tillerburr/pymdownx-blocks
markdown mkdocs mkdocs-material pymdown-extensions python
Last synced: about 2 months ago
JSON representation
Custom Blocks for PyMdown Extensions
- Host: GitHub
- URL: https://github.com/tillerburr/pymdownx-blocks
- Owner: TillerBurr
- License: mit
- Created: 2023-10-25T20:25:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-12T21:21:26.000Z (about 1 year ago)
- Last Synced: 2024-11-11T16:03:39.195Z (about 2 months ago)
- Topics: markdown, mkdocs, mkdocs-material, pymdown-extensions, python
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyMdown Extensions Blocks
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![PyPI - Version](https://img.shields.io/pypi/v/pymdownx-blocks)](https://pypi.org/project/pymdownx-blocks/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pymdownx-blocks)
[![Tests](https://github.com/TillerBurr/pymdownx-blocks/workflows/Tests/badge.svg)](https://github.com/TillerBurr/pymdownx-blocks/actions)These are a collection of blocks for the [PyMdown Extensions](https://facelessuser.github.io/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`.
## Installation
```bash
pip install pymdownx-blocks
```## Usage
This can be used in MkDocs or by itself. To use in a Python file, we use the following:```python
import markdownyaml_str=...
md=markdown.Markdown(extensions=['pymdownx_blocks.dirtree'])
```To use in MkDocs, register the extension.
```yaml
...
markdown_extensions:
...
- pymdownx_blocks.dirtree
...
```In a markdown file,
```
///dirtreeroot:
- 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## Contributing
More blocks are always welcome! This project uses [rye](https:rye-up.com) for dependency
management.1. Fork the repository
2. Create a branch with the name of the block
3. Implement the block
4. Create a pull request.