Skip to content

Commit 275e9f5

Browse files
authored
docs: Add spaces around anchor ids to ensure compatibility with the macros plugin
The mkdocs-macros-plugin tries to render the markup, and Jinja thinks `{#` is the opening of a comment block. To ensure compatibility with the mkdocs-macros-plugin, we add spaces around anchor ids in our docs. PR-64: #64
1 parent e35ce91 commit 275e9f5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ The autorefs plugin offers a feature called "Markdown anchors". Such anchors can
8585
The syntax is:
8686

8787
```md
88-
[](){#id-of-the-anchor}
88+
[](){ #id-of-the-anchor }
8989
```
9090

91-
If you look closely, it starts with the usual syntax for a link, `[]()`, except both the text value and URL of the link are empty. Then we see `{#id-of-the-anchor}`, which is the syntax supported by the [`attr_list`](https://python-markdown.github.io/extensions/attr_list/) extension. It sets an HTML id to the anchor element. The autorefs plugin simply gives a meaning to such anchors with ids. Note that raw HTML anchors like `<a id="foo"></a>` are not supported.
91+
If you look closely, it starts with the usual syntax for a link, `[]()`, except both the text value and URL of the link are empty. Then we see `{ #id-of-the-anchor }`, which is the syntax supported by the [`attr_list`](https://python-markdown.github.io/extensions/attr_list/) extension. It sets an HTML id to the anchor element. The autorefs plugin simply gives a meaning to such anchors with ids. Note that raw HTML anchors like `<a id="foo"></a>` are not supported.
9292

9393
The `attr_list` extension must be enabled for the Markdown anchors feature to work:
9494

@@ -107,7 +107,7 @@ Now, you can add anchors to documents:
107107
```md
108108
Somewhere in a document.
109109
110-
[](){#foobar-paragraph}
110+
[](){ #foobar-paragraph }
111111
112112
Paragraph about foobar.
113113
```
@@ -123,15 +123,15 @@ Check out the [paragraph about foobar][foobar-paragraph].
123123
If you add a Markdown anchor right above a heading, this anchor will redirect to the heading itself:
124124

125125
```md
126-
[](){#foobar}
126+
[](){ #foobar }
127127
## A verbose title about foobar
128128
```
129129

130130
Linking to the `foobar` anchor will bring you directly to the heading, not the anchor itself, so the URL will show `#a-verbose-title-about-foobar` instead of `#foobar`. These anchors therefore act as "aliases" for headings. It is possible to define multiple aliases per heading:
131131

132132
```md
133-
[](){#contributing}
134-
[](){#development-setup}
133+
[](){ #contributing }
134+
[](){ #development-setup }
135135
## How to contribute to the project?
136136
```
137137

@@ -160,11 +160,11 @@ Each page has:
160160
You don't want to change headings and make them redundant, like `## Arch: Install with package manager` and `## Debian: Install with package manager` just to be able to reference the right one with autorefs. Instead you can do this:
161161

162162
```md
163-
[](){#arch-install-pkg}
163+
[](){ #arch-install-pkg }
164164
## Install with package manager
165165
...
166166
167-
[](){#arch-install-src}
167+
[](){ #arch-install-src }
168168
## Install from sources
169169
...
170170
```

0 commit comments

Comments
 (0)