Replace text by dictionary.
Project description
# Replace text for Foliant
Replace preprocessor reads the dictionary (yaml format) placed in foliant project folder and changes one word to another.
## Installation
```shell
$ pip install foliantcontrib.replace
```
## Config
To enable the preprocessor, add `replace` to `preprocessors` section in the project config:
```yaml
preprocessors:
- replace
```
The preprocessor has only one option:
```yaml
preprocessors:
- multilinetables:
dictionary_filename: replace_dictionary.yml
```
`dictionary_filename`
: File in foliant project folder with dictionary in it (*replace_dictionary.yml* by default).
### Dictionary format
Dictionary stores data in yaml format. It has two sections — with words and with regular expressions. For example:
```yaml
words:
cod: CoD
epg: EPG
vod: VoD
regexs:
'!\w*!': ''
```
## Usage
Just add the preprocessor to the project config, set the dictionary and enjoy the result.
Replace preprocessor reads the dictionary (yaml format) placed in foliant project folder and changes one word to another.
## Installation
```shell
$ pip install foliantcontrib.replace
```
## Config
To enable the preprocessor, add `replace` to `preprocessors` section in the project config:
```yaml
preprocessors:
- replace
```
The preprocessor has only one option:
```yaml
preprocessors:
- multilinetables:
dictionary_filename: replace_dictionary.yml
```
`dictionary_filename`
: File in foliant project folder with dictionary in it (*replace_dictionary.yml* by default).
### Dictionary format
Dictionary stores data in yaml format. It has two sections — with words and with regular expressions. For example:
```yaml
words:
cod: CoD
epg: EPG
vod: VoD
regexs:
'!\w*!': ''
```
## Usage
Just add the preprocessor to the project config, set the dictionary and enjoy the result.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for foliantcontrib.replace-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5633f684e2c6e8d2cd81656d0f75b2fd77565b3e6637a1eba0acd1fed63a0a4 |
|
MD5 | c17c152912591dce8ee2853bf44dafdc |
|
BLAKE2b-256 | 035a8f082ad3dcc5598b9037c2db4e42cbff510b014ae6b201c2b2d39e09bb0c |