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
{{ message }}
Repository navigation
Inclusion of files with :relative-images:/:relative-docs: doesn't seem to work on links to images #1041
# Set the version of Python and other tools you might needbuild:
os: ubuntu-24.04tools:
python: "3.11"
What operating system are you using?
Linux
Describe the Bug
When including .md files from other directories, like README.md from the repo root, :relative-images:/:relative-docs: doesn't seem to work on links to images.
changed the title [-]Inclusion of files `:relative-images:`/`:relative-docs:` doesn't seem to work on links to images[/-][+]Inclusion of files with `:relative-images:`/`:relative-docs:` doesn't seem to work on links to images[/+]on Jul 16, 2025
I'd like to work on this. It still happens on MyST-Parser 5.2.0 with Sphinx 9.1.1. In a file included with :relative-docs: and :relative-images:,  is rewritten to _images/a.png, but [link to image](pics/a.png) becomes href="#pics/a.png" with a myst.xref_missing warning.
My plan is to apply the same relative-path rewriting to plain links that point at files in the included content, with a test. Would a PR along those lines be welcome, or is there a reason links are left as they are?
Activity
[-]Inclusion of files `:relative-images:`/`:relative-docs:` doesn't seem to work on links to images[/-][+]Inclusion of files with `:relative-images:`/`:relative-docs:` doesn't seem to work on links to images[/+]Metadorius commentedon Jul 16, 2025
Uh the docs were updated, so there's no live example anymore. If needed I can make another example PR.
OmkarGowda990 commentedon Nov 20, 2026
I'd like to work on this. It still happens on MyST-Parser 5.2.0 with Sphinx 9.1.1. In a file included with
:relative-docs:and:relative-images:,is rewritten to_images/a.png, but[link to image](pics/a.png)becomeshref="#pics/a.png"with amyst.xref_missingwarning.My plan is to apply the same relative-path rewriting to plain links that point at files in the included content, with a test. Would a PR along those lines be welcome, or is there a reason links are left as they are?