0

How do I link to a non-markdown file in a Jupyter Book? I would expect that [some text](relative-link) works, but this is not the case.

For example, starting from a brand new Jupyter Book suppose in the source file I write in the generated intro.md file:

A link to [a markdown file](some-file.md)

A link to [a text file](other-file.txt).

Then I place some-file.md and other-file.txt next to intro.md and build the book. I get the error message:

intro.md:20: WARNING: 'myst' reference target not found: other-file.txt

Then some-file.md is processed and a link to some-file.html is generated (as expected), while the link to other-file.txt is not, and the file is not copied to _build.

If I place other-file.txt into the _static folder then it gets copied to _build/html/_static, but how do I refer to it? And in any case, it's silly that I should have put it in _static.

I would like to link to files that students can download (for instance a ZIP file or some source code that they should use). Surely this is possible?

Andrej Bauer
  • 2,458
  • 17
  • 26

1 Answers1

0

You can try

...the easiest way to do this is with the {download} role ...

as answered here https://github.com/executablebooks/meta/discussions/475#discussioncomment-1259744 by @choldgraf , i.e.,

A link to {Download}`a text file<./other-file.txt>`.

This also copies the corresponding files correctly.

red-isso
  • 305
  • 1
  • 7