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

Link to local notebooks with uppercase characters #196

Closed
jnquintin opened this issue Jul 16, 2018 · 9 comments
Closed

Link to local notebooks with uppercase characters #196

jnquintin opened this issue Jul 16, 2018 · 9 comments

Comments

@jnquintin
Copy link

It tooks me some times to understand why my links did not works.
I have notebooks with names like Overview.ipynb and Getting_Started.ipynb .
If overview have like like [Getting Started](Getting_Started.ipynb), the link is removed because sphink do not found Getting_Started.

If I change the name of my files to overview.ipynb and getting_started.ipynb, it works.

@mgeier
Copy link
Member

mgeier commented Jul 17, 2018

Thanks for the report!

I cannot reproduce the problem, though. For me (on Debian Linux) uppercase file names work.
Uppercase/lowercase problems sound a lot like Windows ...

What about *.rst files, do they work for you with uppercase?

If not, this might be a Sphinx problem, in this case you should ask at the Sphinx issue tracker: https://github.com/sphinx-doc/sphinx/issues

If *.rst files do work, can you please provide an example project that shows your problem? E.g. as a https://gist.github.com/?

@fcollonval
Copy link
Contributor

I confirm this bug. The versions used are:

  • nbsphinx 0.3.3
  • sphinx 1.7.5
  • python 3.6.5
  • Windows 7 64bit

The following patch on RewriteLocalLinks.apply works for me.

@@ -1076,9 +1076,9 @@ def apply(self):
                target_docname = nbconvert.filters.posix_path(os.path.normpath(
                    os.path.join(os.path.dirname(env.docname), target)))
                if target_docname in env.found_docs:
                    reftarget = target_docname + target_ext
+                   reftarget = '/' + reftarget
-                   reftarget = '/' + reftarget.lower()
                    linktext = node.astext()
                    xref = sphinx.addnodes.pending_xref(
                        reftype=reftype, reftarget=reftarget, refdomain=refdomain,
                        refwarn=True, refexplicit=True, refdoc=env.docname)

But as you wrote, better checking if it is a bug with Sphinx or not.

@fcollonval
Copy link
Contributor

*.rst files with uppercase names are working

@mgeier
Copy link
Member

mgeier commented Jul 17, 2018

Sorry, my bad, I didn't check thoroughly enough ... I now also can reproduce the problem ... working on a fix ...

@jnquintin
Copy link
Author

Thanks for your reactivity. My setup is:

  • nbsphinx 0.3.3
  • sphinx 1.7.5
  • python 3.4
  • rhel7.4

@mgeier
Copy link
Member

mgeier commented Jul 17, 2018

Thanks @fcollonval and @jnquintin for the detailed reports!

I've just created #198, can you please check if that fixes the issue?

@fcollonval
Copy link
Contributor

@mgeier your fix is working for me.
Thanks for the reactivity.

@mgeier mgeier closed this as completed in 20a3212 Jul 17, 2018
@mgeier
Copy link
Member

mgeier commented Jul 17, 2018

No problem, thanks for your help!

I'll make a new release next week.

@jnquintin
Copy link
Author

@mgeier thanks it works for me too.

mgeier added a commit that referenced this issue Feb 3, 2019
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