Metadata-Version: 2.3
Name: mkdocs-strings-replacement
Version: 0.1.0
Summary: Mkdocs strings replacement.
License-Expression: MIT
License-File: LICENSE
Keywords: markdown,mkdocs,plugin,replacement
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.8
Requires-Dist: mkdocs>=1.6
Description-Content-Type: text/markdown

# mkdocs-strings-replacement

[![PyPI][pypi-version-badge-link]][pypi-link]
[![License][license-image]][license-link]

Mkdocs Markdown strings replacement plugin.

## Installation

```bash
pip install mkdocs-strings-replacement
```

## Documentation

### Setup

Enable the plugin in your `mkdocs.yml`:

```yaml
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 the `old_value`'s of the strings you want to replace with `new_value`'s of the strings you want to put there in exchange.
- If you add more then one `old_value` and `new_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
```yaml
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:
```sh
pip install .
```

To set up the development environment, including dependencies for running tests, run:
```sh
pip install -e .[dev]
```

To run the tests, use:
```sh
pytest
```

[pypi-link]: https://pypi.org/project/mkdocs-strings-replacement
[pypi-version-badge-link]: https://img.shields.io/pypi/v/mkdocs-strings-replacement?logo=pypi&logoColor=white
[license-image]: https://img.shields.io/pypi/l/mkdocs-strings-replacement?color=light-green&logo=apache&logoColor=white
[license-link]: https://github.com/innersource-nn/midgard-mkdocs-plugins/blob/main/mkdocs-strings-replacement-plugin/LICENSE