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
context
When I have an embedded autodoc entry in my markdown file for myst to build, any references in the docstring are rendered invalid.
Was initially reported in #228 (comment) but was off topic to the issue there (my bad).
expectation
I expect the links to be created with the correct name and the correct href target set.
bug
But instead myst generates a warning about an unknown target and the link in the rendered docs points to an invalid target happens.
Here's an error message I ran into...
$ sphinx-build .../path/to/mymodule/__init__.py:docstring of mymodule.my_function:12: ERROR: Unknown target name: "link".
The converted HTML has the following element set for this is
problem
This is a problem for people trying to generate Python docs from a docstring using automodule because it breaks any embedded links they may have in the docstring itself.
The same docstring works just fine if I have an rst with the autodoc entry and is rendered outside of MyST. Unfortunately as mentioned in #519 the latest release seems to have changed how links are referenced so my other MyST generated docs that had the following now no longer work.
[Link To My Function](./source/mymodule.html#mymodule.my_function)
By using a markdown file to embed the autodoc entries these links now work, albiet in a slightly different way, but the actual docstring references in the function/classes are broken. Happy to try out anything as right now I'm stuck on the older version where both scenarios still work.
Reproduce the bug
Create a markdown file in your docs build with the following contents
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
I'm still experiencing the same issue. I am forced to use autodoc directives in rst files only. An alternative is to use inline references but this is far from ideal. e.g.
defmy_function():
"""Header Some text with a `link <https://github.com>`_. """pass
@jborean93 did you ever find a good solution for this?
Describe the bug
context
When I have an embedded autodoc entry in my markdown file for myst to build, any references in the docstring are rendered invalid.
Was initially reported in #228 (comment) but was off topic to the issue there (my bad).
expectation
I expect the links to be created with the correct name and the correct href target set.
bug
But instead myst generates a warning about an unknown target and the link in the rendered docs points to an invalid target happens.
Here's an error message I ran into...
The converted HTML has the following element set for this is
problem
This is a problem for people trying to generate Python docs from a docstring using automodule because it breaks any embedded links they may have in the docstring itself.
The same docstring works just fine if I have an
rst
with the autodoc entry and is rendered outside of MyST. Unfortunately as mentioned in #519 the latest release seems to have changed how links are referenced so my other MyST generated docs that had the following now no longer work.By using a markdown file to embed the autodoc entries these links now work, albiet in a slightly different way, but the actual docstring references in the function/classes are broken. Happy to try out anything as right now I'm stuck on the older version where both scenarios still work.
Reproduce the bug
Create a markdown file in your docs build with the following contents
Inside your
mymodule
create a dummy function with the followingA docstring (Google style) I'm using is something like
Sphinx can be invoked like
sphinx-build -M html "source_dir" "build_dir" -W --keep-going
to run the build process.List your environment
Not using Jupyter but just Sphinc with this library and autodoc. I'm running Sphinx with Python 3.8,
myst-parser==0.17.0
, andSphinx==4.4.0
.The text was updated successfully, but these errors were encountered: