lektor-markdown-header-anchors
This plugin extends the markdown support in Lektor in a way that headlines are given anchors and a table of contents is collected.
Enabling the Plugin
To enable the plugin run this command:
$ lektor plugins add markdown-header-anchors
In Templates
Within templates it becomes possible to access the .toc property of
markdown data. It's a list where each item has the following attributes:
anchor: the name of the anchortitle: the title of the headline as HTMLchildren: a list of headers below that header
Example rendering:
<h4>Table Of Contents</h4>
<ul class="toc">
{% for item in this.body.toc recursive %}
<li><a href="#{{ item.anchor }}">{{ item.title }}</a>{%
if item.children %}<ul>{{ loop(item.children) }}</ul>{% endif %}</li>
{% endfor %}
</ul>
Release files for lektor-markdown-header-anchors 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lektor_markdown_header_anchors-0.4.0.tar.gz | 37.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lektor_markdown_header_anchors-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.7 kB
Release files / lektor_markdown_header_anchors-0.4.0.tar.gz
| Download URL | lektor_markdown_header_anchors-0.4.0.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74663067bca240ef8c3e325982712f30e94fa3c7b91a8a19bffa9bb143b17d8e
|
|
BLAKE2b-256 checksum How to use checksums |
0614d20638c0cfe011afa46a0861634aa0f886a75dfd60ef9a4327950749bd31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / lektor_markdown_header_anchors-0.4.0-py3-none-any.whl
| Download URL | lektor_markdown_header_anchors-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b5ec3f7dcc28ae7887a028400d518b50bd3bb926fe23d2935dd080a4122fb54
|
|
BLAKE2b-256 checksum How to use checksums |
a326e8d896b7003e9aac1eed4a68c11dfa6c65990b8a69b33fdd828841420e66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|