mdformat-mkdocs is an mdformat plugin designed to format Markdown files specifically tailored for MkDocs and Material for MkDocs. It handles features like blockquote directives (admonitions) and other MkDocs-specific syntax, ensuring consistent styling when used with the `mdformat` CLI tool. It is actively maintained and generally follows the release cadence of its host library, `mdformat`, releasing updates as needed to maintain compatibility and add features.
pip install mdformat-mkdocsNo compatibility data collected yet for this library.
This quickstart demonstrates how to install `mdformat-mkdocs` and use it to format a Markdown file with MkDocs-specific syntax, such as admonitions. The `mdformat` command-line tool is used, and the `--plugins mkdocs` argument explicitly enables the plugin. The example shows how to format a file and then read its content, as `mdformat` typically modifies files in-place.
Ensure your `mdformat` installation is up-to-date: `pip install --upgrade mdformat mdformat-mkdocs`.
Add `--plugins mkdocs` to your `mdformat` command: `mdformat --plugins mkdocs your_file.md` or add `plugins = ["mkdocs"]` under `[tool.mdformat]` in your `pyproject.toml`.
Review `mdformat`'s changelog, especially for major version bumps. If specific formatting styles are desired, configure them in `pyproject.toml` using `mdformat`'s style options (e.g., `wrap = "keep"`, `number = true`).
Ensure `mdformat-mkdocs` is correctly installed in your environment: `pip install mdformat-mkdocs`. If using a virtual environment, ensure it's activated.
Enable the plugin via the CLI (`mdformat --plugins mkdocs your_file.md`) or in `pyproject.toml` (`[tool.mdformat] plugins = ["mkdocs"]`).
Install `mdformat-mkdocs`: `pip install mdformat-mkdocs`. If in a virtual environment, ensure it's activated before installation.