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
With rST I set default_role = "py:obj" in my conf.py, and then I can link to API docs like this:
The image you give to `stbt.match` or `stbt.wait_for_match` ...
Where "stbt" is the name of my Python module. The above automatically links to the documentation for those functions, which I have generated with autodoc.
With MyST, I have to do this:
The image you give to [stbt.match] or [stbt.wait_for_match] ...
[stbt.match]: stbt.match
[stbt.wait_for_match]: stbt.wait_for_match
Other syntaxes I tried:
markdown
does it work
notes
[stbt.match]
✗
Generates literal text (including brackets): [stbt.match]
[](stbt.match)
✗
Generates a hyperlink with the correct target but with no text, so it's invisible.
{ref}`stbt.match`
✗
Text appears, no hyperlink.
{py:obj}`stbt.match`
✓
{any}`stbt.match`
✓
[](stbt.match) does generate the correct link, but with no text:
So... is the lack of text a bug in MyST or in autodoc? Perhaps if there's no text, MyST should use the text in the parentheses? (i.e. "stbt.match").
My ideal syntax would be [stbt.match], i.e. use the text in the brackets as the reference (if a reference isn't explicitly provided in parentheses like [text](reference) or later in the document like [text]: reference).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
With rST I set
default_role = "py:obj"
in myconf.py
, and then I can link to API docs like this:Where "stbt" is the name of my Python module. The above automatically links to the documentation for those functions, which I have generated with autodoc.
With MyST, I have to do this:
Other syntaxes I tried:
[stbt.match]
[stbt.match]
[](stbt.match)
{ref}`stbt.match`
{py:obj}`stbt.match`
{any}`stbt.match`
[](stbt.match)
does generate the correct link, but with no text:For reference, this is what the rST input
`stbt.match`
generates:Note that this does work for other types of references. If I have this in one rST document:
...and then in another markdown document:
It does generate what you expect:
So... is the lack of text a bug in MyST or in autodoc? Perhaps if there's no text, MyST should use the text in the parentheses? (i.e. "stbt.match").
My ideal syntax would be
[stbt.match]
, i.e. use the text in the brackets as the reference (if a reference isn't explicitly provided in parentheses like[text](reference)
or later in the document like[text]: reference
).Beta Was this translation helpful? Give feedback.
All reactions