Replace text for Foliant
Preprocessor for simple search and replace in Markdown sources with support of regular expressions.
Installation
$ pip install foliantcontrib.replace
Config
To enable the preprocessor, add replace to preprocessors section in the project config:
preprocessors:
- replace
The preprocessor has two options:
preprocessors:
- replace:
dictionary:
Mike: Michael
Sam: Samuel
Tim: Timoel
re_dictionary:
'!\[\]\((.+?)\)': ''
dictionary
: YAML mapping where key is string to replace, value is the replacement string.
re_dictionary
: YAML mapping where key is Python regular expression pattern, value is the replacement string.
Usage
Fill up the dictionary or/and re_dictionary in preprocessor options and the keys will be replaced with values.
For example, if you wish that all images without title in your Markdown sources were titled "Figure", use the following config:
preprocessors:
- replace:
re_dictionary:
'!\[\]\((.+?)\)': ''
Metadata
Release files for foliantcontrib.replace 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| foliantcontrib.replace-2.0.0.tar.gz | 3.8 kB | Without provenance | Details for foliantcontrib.replace-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| foliantcontrib.replace-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for foliantcontrib.replace-2.0.0-py3-none-any.whl |
Total release size: 7.4 kB
Release files / foliantcontrib.replace-2.0.0.tar.gz
| Download URL | foliantcontrib.replace-2.0.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49e3a8b55e74ef85a43136d35d23b933cb3916635a0aabb85333d984926d54d0
|
|
BLAKE2b-256 checksum How to use checksums |
9d547787a697419d9d81f5e33d145091f022e0cdf68e0513e59709c8013ea8a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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.9
|
Release files / foliantcontrib.replace-2.0.0-py3-none-any.whl
| Download URL | foliantcontrib.replace-2.0.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
304329cc5878b43018378d079add4574a50eef7bb0768991f20060760e3160c5
|
|
BLAKE2b-256 checksum How to use checksums |
a9438179838b0d1a7bbd04082ecd139623ea0b68e9584d90c28973ad6e3f49a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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.9
|
Security for foliantcontrib.replace 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.