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
When viewing the docs in a browser, we get this (I am using the Display #Anchors extension to make it visible):
Note that both Examples anchors lead to the same URL fragment, namely, example.html#examples, so it is basically impossible to create an external link to a given section of a docstring of an object if the same module has multiple objects with the same header name.
A possible solution would be to just prepend the full name of the object (in this case, example.html#f1-examples and example.html#f2-examples). Note the hyphen between the object and the header name, this is necessary to disambiguate from an identical object called f1_examples (since a hyphen is not allowed anywhere when naming a Python object).
Indeed it does! I'm not seeing any issues upstream though, should I open one? Also, regarding your fix in #497 (comment), I can't really get it to work, would you mind providing a more "complete" example (assuming it still works)?
Problem Description
The URL fragments (stuff after
#
in the URL) in docstrings which have an identical section header are always linked to the same anchor.Steps to reproduce the behavior:
An example is probably best here:
Build the docs using:
When viewing the docs in a browser, we get this (I am using the
Display #Anchors
extension to make it visible):Note that both
Examples
anchors lead to the same URL fragment, namely,example.html#examples
, so it is basically impossible to create an external link to a given section of a docstring of an object if the same module has multiple objects with the same header name.A possible solution would be to just prepend the full name of the object (in this case,
example.html#f1-examples
andexample.html#f2-examples
). Note the hyphen between the object and the header name, this is necessary to disambiguate from an identical object calledf1_examples
(since a hyphen is not allowed anywhere when naming a Python object).System Information
The text was updated successfully, but these errors were encountered: