mkdocs-material/docs/extensions/permalinks.md

32 lines
869 B
Markdown
Raw Normal View History

# Permalinks
Permalinks are a feature of the [Table of Contents][] extension, which is part
2016-11-02 21:21:14 +03:00
of the standard Markdown library. The extension inserts an anchor at the end of
each headline, which makes it possible to directly link to a subpart of the
document.
## Installation
2016-11-02 21:21:14 +03:00
To enable permalinks, add the following to your `mkdocs.yml`:
2016-11-02 21:21:14 +03:00
``` yaml
markdown_extensions:
- toc(permalink=true)
```
2016-12-15 17:55:40 +03:00
This will add a link containing the paragraph symbol `¶` at the end of each
headline (exactly like on the page you're currently viewing), which the
Material theme will make appear on hover. In order to change the text of the
permalink, a string can be passed, e.g.:
``` markdown
2016-11-02 21:21:14 +03:00
markdown_extensions:
- toc(permalink=Link)
```
## Usage
When enabled, permalinks are inserted automatically.
[Table of Contents]: https://pythonhosted.org/Markdown/extensions/toc.html