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_replacementsis 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_valueandnew_valuepairs 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
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 mkdocs_strings_replacement-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_strings_replacement-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73f976220b30062a69172de846e5674696f30685b67443380c9cf65bbbf78bb6
|
|
| MD5 |
4fb5862a1d59abb63788ec5a100389fc
|
|
| BLAKE2b-256 |
9410447073376775c33e56b471dc610a770bf879d16eadc9f3dd284cd981d3f6
|
File details
Details for the file mkdocs_strings_replacement-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_strings_replacement-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2003457920ac06ed9711832adf1b1af270bba38b5d18726467379b0d62d36a01
|
|
| MD5 |
559fdd5c6117a576cdee5d08f265f37e
|
|
| BLAKE2b-256 |
7f39340c1bfd1d6f2a21452cf3bc91c595b7c8ccb60a2cc3f98ded65fa33a793
|