-
Notifications
You must be signed in to change notification settings - Fork 200
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
inline links to *.md files no longer work, starting with v0.19.0 #749
Comments
After much experimentation, I found that omitting the Is there a way to preserve the portability we had in 0.18? Was this change intentional? |
Hi @jclerman, These links are certainly working in the tests and in the documented examples: https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html#examples Perhaps you could link to your project, where this is appears to be not working, or provide a minimal working example?
yeh this is more of a workaround than a solution 😅 |
Did you also try |
Hi @chrisjsewell, this is a private project so I can't simply link to it, unfortunately. I will see about creating a minimal example that shows the issue. In the meantime (or maybe instead?) here is my Sphinx
|
Apologies for posting it this way - but attached is a (very small) tgz file containing a small (may not quite be minimal) example demonstrating the issue. To use (one way to do it):
|
I have a similar problem, since v0.19 but only in a multi-language Sphinx project, when compiling a translated version and with links in the form Maybe I should open a separated issue for this? |
Hi @chrisjsewell , I don't mean to nag at all - but not sure if you still need more info on this (it's still tagged that way) or if the info I provided was sufficient to reproduce the issue? |
If it can help, inrupt/solid-client-notifications-js#552 reproduces the issue, and even if this specific PR upgrades |
I'm a new maintainer here, getting up to speed. Without a deep knowledge of what's going on here 0.19 was the first release IIRC to include new reference/link resolution syntax. It might be that we don't opt-in to that in all cases, breaking existing usage. I'll take a look at this, and report back! |
Heya @jclerman, to paraphrase your example, you have, files:
and then:
.. include:: general/overview.md
:parser: myst_parser.sphinx_
Here is the [algorithm](../general/algorithm.md) The
Here is the [algorithm](../general/algorithm.md). Hopefully, you can see here that your relative document link is now incorrectly resolved to If you are including documents into other documents, then relative document paths must either be relative to the including/parent document, or you can use absolute paths, starting with Does make sense? |
@n-peugnet and @NSeydoux if your issue is different to what I describe above, then yeh it would probably be best if you open a separate issue, ideally also with a similar reporducible example thanks |
Hi @chrisjsewell, thanks. Using absolute paths does work, but I would really like to be able to use paths that are relative to the *.md file in which they are written - or at least some way to have absolute paths that use the repository root as their root, so that xrefs continue to work with other parsers (that don't consider (my original response here included a complaint about continued problems with relative xrefs, but I now understand that those are explained by your explanation above) It occurs to me that some of this confusion could be resolved elegantly if the xrefs were, during parsing, resolved (to absolute paths) before any |
One more thought on this: It seems like The tolerant behavior must have been removed from |
…when possible - inter-page links must only use .html extension when followed by an anchor - e.g. ../index.html#list-of-licenses - workaround for executablebooks/MyST-Parser#564, executablebooks/MyST-Parser#749
…when possible - inter-page links must only use .html extension when followed by an anchor - e.g. ../index.html#list-of-licenses - workaround for executablebooks/MyST-Parser#564, executablebooks/MyST-Parser#749
I'm a new user trying out MyST with sphinx in an existing project. I had high hopes for it especially for the promised links translations. But I encountered exactly the same problem with links relative to the .md file they are located in not working as promised. Looks like there was a regression in v0.19, and now it is at v2.0 with the same problem remaining, and no activity here for good 10 months. Is there any plan to fix this issue? What would it take? Is there any workaround that won't break .md files for Github (Besides downgrading to v0.18)? |
@chrisjsewell if try to include the .md file and it include a relative path which links to another .md file in the parent folder, WARNING still happends. For example, I have files: docs/
index.md
README.md
README-en.md in ```{include} ../README.md
``` in [English](README-en.md) run C:\Users\wtwang\Documents\GitHub\PyStatPower\PyStatPower\README.md:18: WARNING: 'myst' cross-reference target not found: 'README-en.md' [myst.xref_missing] It seems that there's no solution in this scenario, whether I use an absolute path or a relative path, since the source folder is consistently set to |
Describe the bug
context
When I create the following Markdown file:
my-docs.md
(there is another Markdown file
details.md
, in the same directory).expectation
I expected a link to be created, leading to the 2nd file (details.md).
I verified that I am following the guidance in the documentation, here, specifically:
bug
But instead I get an error when I try to build my documentation:
problem
I can't figure out how to insert links between Markdown files using
myst-parser
>=0.19.Reproduce the bug
See summary above. I invoke sphinx via:
sphinx-build -M html "." "_build" -W
List your environment
The text was updated successfully, but these errors were encountered: