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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 050992a76e1dc7a7b6a6078123b0ab347e65f501239cf7a6071ab30d0cdaa2b7 |
|
MD5 | 42fe91b4f4254a1b4f0ef143d6d91329 |
|
BLAKE2b-256 | 2d3b00b0b0fc9a950b4ce0be90f813dc3f1aa2bc1e052d6379a3034d7f5201bc |
Close
Hashes for mkdocs_strings_replacement-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b76b093e519b7ccc2a7ad33f8e491941004faf903d731817828413aa2387a870 |
|
MD5 | d7a198087a5504591f05aaff985903cd |
|
BLAKE2b-256 | 05fc0781cfb5c471b16bb5dc6a9ddf05e6fb15ae77e655233952eecf69db0c78 |