A series of snippets to create custom fences for mkdocs
Project description
MKDOCS CUSTOM FENCES
This package is for mkdocs and include some "code snippet" to create custom fences using pydownx superfences. This allow to customize your code blocks during the processor of your mkdocs.
For the moment, it includes only md_render.
Get started
pip install mkdocs_custom_fences
After the installation you should be able to access the extensions in mkdocs.yml
using mkdocs_custom_fences.file.class
. See below for more information using configuration.
Mkdocs configuration
In your mkdocs.yml
configuration you need to configure superfences to use custom fences.
markdow_extensions:
pymdownx.superfences:
custom_fences:
- name: language
class: language
format: !!python/name:mkdocs_custom_fences.file.class
Markdown Render
→ Configuration : !!python/name:mkdocs_custom_fences.md_render.md_sub_render
This custom formattor allow you to "force" markdown and remove the code block.
Add this in your configuration :
markdow_extensions:
pymdownx.superfences:
custom_fences:
- name: md-render
class: md-render
format: !!python/name:mkdocs_custom_fences.md_render.md_sub_render
💡You can customize the name and class with any language you want.
Example :
```md-render
|Col0|Col1|Col2|Col3|
|----|----|----|----|
|xml |x|x|x|
```
Will become :
Contribution
I will be happy to see any new configuration and custom fences.
To contribute :
- Fork and clone this project
pip install -r requirements.txt
(I advice you to use virtual environment ; personnaly I use conda.)- Create a new file (don't use any already custom fences for new customization). Don't forget to update the requirements.txt if you need).
- Edit this README to add an example and the configuration.
- Add the custom fences to the list.
- Create a pull request
⚠️ You need to use conventionnal commit as described here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mkdocs_custom_fences-0.1.2.tar.gz
.
File metadata
- Download URL: mkdocs_custom_fences-0.1.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04172a8e1a8232979aa4972ce6fdaa976775e50faf1f741fbc347d7a39ac21c7 |
|
MD5 | 1b3d0e839885f4c25ea0c1fed676ba5b |
|
BLAKE2b-256 | 2a25ee1230d0b81a2c756de640d0b4d7a4d52422cbb00aa56ae8667ad2263cad |
File details
Details for the file mkdocs_custom_fences-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_custom_fences-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f4178b61e2edda468e9ece6dbfd8a0ac7f472d6464730e79f51577f5d1c9a1c |
|
MD5 | 982b45aae2bd098b8332533a5ff9fa54 |
|
BLAKE2b-256 | 398188f4dad947ff1b00832df90c9a9b18e3baba0dfef919a1199df025bb087f |