Preprocessor for admonitions
Project description
Admonitions preprocessor for Foliant
Preprocessor which tries to make admonitions syntax available for most backends.
Admonitions are decorated fragments of text which indicate a warning, notice, tip, etc.
We use rST-style syntax for admonitions which is already supported by mkdocs backend with admonition extension turned on. This preprocessor makes this syntax work for pandoc and slate backends.
Installation
$ pip install foliantcontrib.admonitions
Config
Just add admonitions into your preprocessors list. Right now the preprocessor doesn't have any options:
preprocessors:
- admonitions
Usage
Add an admonition to your Markdown file:
!!! warning "optional admonition title"
Admonition text.
May be several paragraphs.
Currently supported backends:
pandocmkdocs*slate
* for admonitions to work in mkdocs, add admonition to the markdown_extensions section of your mkdocs.yml config:
backend_config:
mkdocs:
mkdocs.yml:
markdown_extensions:
- admonition
Notes for slate
Slate has its own admonitions syntax of three types: notice (blue notes), warning (red warnings) and success (green notes). If another type is supplied, slate draws a blue note but without the "i" icon.
Admonitions preprocessor transforms some of the general admonition types into slate's for convenience (so you could use error type to display same kind of note in both slate and mkdocs). These translations are indicated in the table below:
| original type | translates to |
|---|---|
| error | warning |
| danger | warning |
| caution | warning |
| info | notice |
| note | notice |
| tip | notice |
| hint | notice |
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foliantcontrib.admonitions-1.0.1.tar.gz.
File metadata
- Download URL: foliantcontrib.admonitions-1.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a7df139cd600b7b1556f2cc038e6c395b1c92d01cf7b02c63f92f950e58869a
|
|
| MD5 |
920fd0f225ce57888f212dcb73981151
|
|
| BLAKE2b-256 |
4fa24bdd18facff94fc5c5d109490d587cb27edde8b5835c357824fe4903cc36
|
File details
Details for the file foliantcontrib.admonitions-1.0.1-py3-none-any.whl.
File metadata
- Download URL: foliantcontrib.admonitions-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90c52dc2376501bc79d8f2785e7cc97da224360d62ddd7b06c219fa0a5c98060
|
|
| MD5 |
1f04925329e14baaae2d5c072574068a
|
|
| BLAKE2b-256 |
a975d693e9ee050562fed3e41d6499d7eee1c408c2cf9c4ccf27173e44684ce2
|