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

toc2 navigation issue #1083

Closed
neverMull opened this issue Sep 8, 2017 · 5 comments
Closed

toc2 navigation issue #1083

neverMull opened this issue Sep 8, 2017 · 5 comments

Comments

@neverMull
Copy link

I recently had to reinstall nbextensions. Since then, when I use toc2 it creates links of the form "href="http://localhost:8888/notebooks/..." This means that when I convert my notebook the resulting html file will link me back to the original ipynb file instead of the new html file. This happens even if I use the toc2 exporter to convert to html. I have no idea why toc2 is now creating links as an absolute file path instead of a relative one, but I would really appreciate any help anyone could give me in fixing this.

@jfbercher
Copy link
Member

ok.
Can reproduce. This affects the toc cell but not the sidebar or window navigation. The bug was introduced in an attempt to fix #1023 which should have been fixed anyway by using scrollIntoView instead if following the click by the native browser method. Thus I think that we can return to relative links for the toc cell.
Try to replace line 70 in toc2.js by

            'href': h.find('.anchor-link').attr('href'),

if ok, I will push a fix later.

@neverMull
Copy link
Author

Thanks, your fix seems to have fixed the problem perfectly.

jfbercher added a commit that referenced this issue Sep 9, 2017
fix for #1083. Revert full url in links to relative to the current page.
@jcb91
Copy link
Member

jcb91 commented Sep 10, 2017

@jfbercher, it seems you've pushed commit ecf4f3d fixing this directly to the repo master instead of making a PR? Although in this case the fix is simple enough that it's not a problem, I think in general it would be better if we could avoid pushing directly to the master branch on the main repo! I'm opening a PR with the relevant commit in 😄

@jfbercher
Copy link
Member

@jcb91 Yep. I thought git will propose to make a PR of this commit but it didn't and applied it directly to master...

@jcb91
Copy link
Member

jcb91 commented Sep 11, 2017

Ok, I'm going to close this as fixed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants