jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

links to .ipynb not working if not in same directory

Open nickeubank opened this issue 1 year ago • 0 comments

I recently migrated from doing my own builds in sphinx with nbsphinx. Notebooks I was using there would often link to each other, but now that I'm building in jupyter-book, it only seems to work if they're in the same directory. if not, I have to change the path to be .HTML.

So [other notebook](that_other_notebook.ipynb) builds fine, but [other notebook](../other_notebooks/that_other_notebook.ipynb) doesn't. It gets interpreted as a sub-link (current page plus # plus all that).

This:

[before](../../notebooks/PDS_note_yet_in_coursera/10_commandline/command_line_part2.ipynb)

Becomes this when built:

file:///Users/nce8/github/practicaldatascience_book/_build/html/ids720_specific/exercises/Exercise_git.html#../../notebooks/PDS_note_yet_in_coursera/10_commandline/command_line_part2.ipynb

So I've been forced to add an html suffix instead of .ipynb. This:

[before](../../notebooks/PDS_note_yet_in_coursera/10_commandline/command_line_part2.html)

builds to this:

file:///Users/nce8/github/practicaldatascience_book/_build/html/ids720_specific/exercises/Exercise_git.html#../../notebooks/PDS_note_yet_in_coursera/10_commandline/command_line_part2.html

and works fine.

There a way to get all .ipynb links to work?

Thanks!

If helpful: here's the page with that particular link, but it's happening throughout the book project in that repo.

EDIT: Add link to book repo.

nickeubank avatar Sep 10 '24 16:09 nickeubank