You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: README.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -85,10 +85,10 @@ The autorefs plugin offers a feature called "Markdown anchors". Such anchors can
85
85
The syntax is:
86
86
87
87
```md
88
-
[](){#id-of-the-anchor}
88
+
[](){#id-of-the-anchor}
89
89
```
90
90
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.
92
92
93
93
The `attr_list` extension must be enabled for the Markdown anchors feature to work:
94
94
@@ -107,7 +107,7 @@ Now, you can add anchors to documents:
107
107
```md
108
108
Somewhere in a document.
109
109
110
-
[](){#foobar-paragraph}
110
+
[](){#foobar-paragraph}
111
111
112
112
Paragraph about foobar.
113
113
```
@@ -123,15 +123,15 @@ Check out the [paragraph about foobar][foobar-paragraph].
123
123
If you add a Markdown anchor right above a heading, this anchor will redirect to the heading itself:
124
124
125
125
```md
126
-
[](){#foobar}
126
+
[](){#foobar}
127
127
## A verbose title about foobar
128
128
```
129
129
130
130
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:
131
131
132
132
```md
133
-
[](){#contributing}
134
-
[](){#development-setup}
133
+
[](){#contributing}
134
+
[](){#development-setup}
135
135
## How to contribute to the project?
136
136
```
137
137
@@ -160,11 +160,11 @@ Each page has:
160
160
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:
0 commit comments