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
This feature only allows recording and retrieving backlinks, for other plugins or systems to render them. Backlinks are not rendered directly by autorefs (though we could consider offering such a feature in the future).
PR-65: #65
Issue-mkdocstrings-723: mkdocstrings/mkdocstrings#723
Issue-mkdocstrings-python-153: mkdocstrings/python#153
Copy file name to clipboardexpand all lines: README.md
+45
Original file line number
Diff line number
Diff line change
@@ -182,3 +182,48 @@ You can also change the actual identifier of a heading, thanks again to the `att
182
182
```
183
183
184
184
...though note that this will impact the URL anchor too (and therefore the permalink to the heading).
185
+
186
+
### Backlinks
187
+
188
+
The autorefs plugin supports recording backlinks, that other plugins or systems can then use to render backlinks into pages.
189
+
190
+
For example, when linking from page `foo/`, section `Section` to a heading with identifier `heading` thanks to a cross-reference `[Some heading][heading]`, the plugin will record that `foo/#section` references `heading`.
191
+
192
+
```md
193
+
# Page foo
194
+
195
+
This is page foo.
196
+
197
+
## Section
198
+
199
+
This section references [some heading][heading].
200
+
```
201
+
202
+
Other plugins or systems integrating with the autorefs plugin can then retrieve backlinks for a specific identifier:
The `get_backlinks` method returns a map of backlink types to sets of backlinks. A backlink is a tuple of navigation breadcrumbs, each breadcrumb having a title and URL.
The default backlink type is `referenced-by`, but can be customized by other plugins or systems thanks to the `backlink-type` HTML data attribute on `autoref` elements. Such plugins and systems can also specify the anchor on the current page to use for the backlink with the `backlink-anchor` HTML data attribute on `autoref` elements.
0 commit comments