Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mkdocs-strings-replacement

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkdocs-strings-replacement

Mkdocs strings replacement.

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

mkdocs-strings-replacement

PyPI License

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 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
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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc