mkdocs-autorefs
mkdocs-autorefs is an MkDocs plugin that automatically creates hyperlinks across pages and to specific sections within your documentation using a simple `[text][identifier]` syntax. It is currently at version 1.4.4 and is actively maintained with frequent, minor updates.
Warnings
- breaking Support for Python 3.8 was dropped in version 1.3.0. Projects using mkdocs-autorefs on Python 3.8 will fail to install or run.
- deprecated Internal constants and classes (`AUTO_REF_RE`, `AutoRefInlineProcessor`) were renamed in version 1.1.0 to `AUTOREF_RE` and `AutorefsInlineProcessor` respectively. Direct programmatic usage of the old names will break.
- gotcha Older versions (prior to 1.0.1) had compatibility issues with `MkDocsConfig` on MkDocs 1.3 and earlier. This could lead to build failures.
Install
-
pip install mkdocs-autorefs
Imports
- AutorefsPlugin
from mkdocs_autorefs.plugin import AutorefsPlugin
Quickstart
site_name: My Docs
plugins:
- search
- autorefs:
enabled: true # Optional, default is true
deduplicate_references: true # Optional, default is true
# Example Markdown usage (e.g., in a file `docs/api.md`):
# Link to another page: [Introduction][index.md]
# Link to a section: [Installation steps][setup.md#installation]