Skip to content

Commit ac77752

Browse files
committedFeb 23, 2025·
Merge branch 'main' of github.com:mkdocstrings/autorefs
2 parents 5dbfca3 + 275e9f5 commit ac77752

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

Diff for: ‎README.md

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

8888
```md
89-
[](){#id-of-the-anchor}
89+
[](){ #id-of-the-anchor }
9090
```
9191

92-
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+
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.
9393

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

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

126126
```md
127-
[](){#foobar}
127+
[](){ #foobar }
128128
## A verbose title about foobar
129129
```
130130

131131
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:
132132

133133
```md
134-
[](){#contributing}
135-
[](){#development-setup}
134+
[](){ #contributing }
135+
[](){ #development-setup }
136136
## How to contribute to the project?
137137
```
138138

@@ -161,11 +161,11 @@ Each page has:
161161
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:
162162

163163
```md
164-
[](){#arch-install-pkg}
164+
[](){ #arch-install-pkg }
165165
## Install with package manager
166166
...
167167
168-
[](){#arch-install-src}
168+
[](){ #arch-install-src }
169169
## Install from sources
170170
...
171171
```

0 commit comments

Comments
 (0)
Please sign in to comment.