Replies: 1 comment 2 replies
-
There seems to be quite a bit confusion about how the links works. Let me try to clarify things a bit:
Inside docstrings nothing works because of mkdocstrings and not because of the plugins. When it processes the files that refer to code, it renders them directly to HTML. it skips the step that renders them as an intermediate representation that would allow other plugins to to modify them before the final conversion (See this issue for more details). See the mkdocs events for more details on how it works internally. I noticed that you seemed confused in your last big PR related to documentation but I assumed that there was indeed something wrong with the plugins. But now I think it was just confusion about the different linking methods supported by mkdocs which I agree can be confusing if you're not used to it and if it isn't clearly documented anywhere. I hope this clears things up. |
Beta Was this translation helpful? Give feedback.
-
I don't know about everybody else, but I'm having a bit of trouble elucidating the rules for linking with autorefs. I guess I'm confused by what plugins we have and what they do, and where.
Markdown links are clear, e.g. link to local file with
[this type of link](other-file#anchor)
In principle one can link to most things with
[this type of link][unique anchor]
, but I'm not sure what counts as aunique-anchor
.For instance, auto-anchors do not work for all headings, but they seem to work for the title of a page
Let's say I have a file
influence/index.md
with:Autoref to the H1 in that file inside a docstring takes preference over aliases of all kinds, including file names. Of all these, only the first works:
Inside docstrings, none do: double brackets do not work for refs to markdown files:
However, inside markdown files double brackets work with:
But not with:
Autoref to the H2 does not work with
Beta Was this translation helpful? Give feedback.
All reactions