Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot link to RST sections since 0.17.0 #872

Open
JulianGro opened this issue Feb 17, 2024 · 4 comments
Open

Cannot link to RST sections since 0.17.0 #872

JulianGro opened this issue Feb 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@JulianGro
Copy link

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

Sphinx 6.2.1

What operating system are you using?

Linux

Describe the Bug

On myst-parser versions before 0.17.0, you can link to RST sections via something like:

[Load and Run a Script](get-started-with-scripting.html#load-and-run-a-script)

This was broken in 0.17.0 #519 (comment)
As far as I can tell, there is still no way to link to RST sections again. It looks like the following should work:

[Load and Run a Script](get-started-with-scripting.rst#load-and-run-a-script)

But that throws a warning and breaks the link:

WARNING: local id not found in doc 'script/get-started-with-scripting': 'load-and-run-a-script' [myst.xref_missing]

Expected Behavior

[Load and Run a Script](get-started-with-scripting.rst#load-and-run-a-script)

should just link to the "load-and-run-a-script" section.

To Reproduce

Here are two example files that should reproduce the issue in a minimal project:
RST_MD_example.zip

@JulianGro JulianGro added the bug Something isn't working label Feb 17, 2024
Copy link

welcome bot commented Feb 17, 2024

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).

Welcome to the EBP community! 🎉

@sumezulike
Copy link
Contributor

Can you provide a full minimal example? Your example includes a lot of unnecessary stuff and link generation works for me when I remove the references to non-existing files.

@JulianGro
Copy link
Author

It indeed seems like the following syntax works now:

+ [Load and Run a Script](get-started-with-scripting.rst#load-and-run-a-script)

However, it does still throw a warning:

myst-test/source/write-scripts.md:3: WARNING: local id not found in doc 'get-started-with-scripting': 'load-and-run-a-script' [myst.xref_missing]

Here is a full minimal example:
myst-test.zip
write-scripts.md tries to link to a section in the RST, which throws a warning.
The README has instruction on how to build the documentation.

Not sure if I saw the warning and assumed that it wouldn't work, if a theme we use breaks it, or if it was broken in the past while still throwing the same warning.

@sumezulike
Copy link
Contributor

I could verify that (seemingly?) unnecessary warnings are being printed, I'll try to write a fix for that. The links all seem to work, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants