Mkdocs strings replacement.
Project description
mkdocs-strings-replacement
Mkdocs Markdown strings replacement plugin.
Installation
pip install mkdocs-strings-replacement
Documentation
Setup
Enable the plugin in your mkdocs.yml
:
plugins:
- mkdocs-strings-replacement:
strings_replacements:
- old_value: "This string will be replaced"
new_value: "with this string"
Note:
- You can replace how many strings as you want.
strings_replacements
is an array of pairs of theold_value
's of the strings you want to replace withnew_value
's of the strings you want to put there in exchange. - If you add more then one
old_value
andnew_value
pairs then the replacement will occur from the top to the bottom of the pairs you have passed. - Replacement will happen for any strings in the markdown, that is also for the content of your markdown file as well as in the titles.
- Replacement will happen before rendering your pages.
Example
plugins:
- mkdocs-strings-replacement:
strings_replacements:
- old_value: "[[_TOSP_]]"
new_value: ""
- old_value: "[[_TOC_]]"
new_value: ""
In the given example:
- First your occurance of
[[_TOSP_]]
will be replaced with nothing, which will results in erasing[[_TOSP_]]
from your pages. - Then from the results
[[_TOC_]]
will be replaced with empty string as well.
Development setup
To install the dependencies for the plugin, run:
pip install .
To set up the development environment, including dependencies for running tests, run:
pip install -e .[dev]
To run the tests, use:
pytest
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
Close
Hashes for mkdocs_strings_replacement-0.0.50.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15d51e3232111b7a3c7a8d2f7cedd60cd281f57a6151ec15601fedc8862da4f0 |
|
MD5 | de88ffdc9c6f0b343077bf8173854438 |
|
BLAKE2b-256 | e30489903a94b6d216a6b67bff655d60d00ff041efee1a6ca5101761becbaada |
Close
Hashes for mkdocs_strings_replacement-0.0.50-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8dee6a060f9f3de75f76f1c295c5bff1f545f3e39e00d78fea59ed149769856 |
|
MD5 | 61b9ed8c97e16efffde89a64ce9608da |
|
BLAKE2b-256 | eeee2c37f7312106e2a0dc71fcacdc59465d910428d0ec63d816c290ae732a5f |