-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix download role #132
Fix download role #132
Conversation
err |
I'm hesitant to bump the version: 1.8 is about 2 years ago, and 2.0 is about 1 year: that's a bit on the short side. This should be weighed against the extra work of course. the role itself doesn't seem like a lot of code, or does it drag a lot with it? |
well it would be the inherited class above as well: https://github.com/sphinx-doc/sphinx/blob/e4c3e24e85a6e32e3f50bc506e895eb356f0ab12/sphinx/util/docutils.py#L342-L435, |
Thanks for fixing this! Other than the above comments, all looks good! |
Cheers, do you want me to copy across the sphinx 2 code into a separate module here then, and move the sphinx requirement back to 1.8? |
It's a tough call:
Ultimately I think bumping sphinx is OK: this repo doesn't have a lot of workforce, and fresher dependencies = less maintenance. Still, I'd like to ask for two extra fixes:
|
done in db05e13 👍 |
dammit the link is not being created for some reason: https://51-73843754-gh.circle-artifacts.com/0/html/index.html#downloading-the-code-as-a-script, this is definitely working locally, I'll look into it... |
I altered your circle-ci setup, to fail on warnings (like we have in executablebooks). Maybe we should check if this has ever actually worked with sphinx >=2, because I don't see how the changes I have made would have affected this? Perhaps there is some change in sphinx 2, altering the order of processes? Note: using this with myst-nb, this code works, because we execute and copy the notebook to the build folder at the start, rather than in a transform, as done in jupyter-sphinx. So the file is there to be found. |
hmm there doesn't seem to be any differences. I just don't see how this was working before, given that the dowloadable documents are processed at read time, before the notebooks/scripts are actually created in the transform: |
Ugh, it was likely broken by #107. |
The only easy (but hacky) fix I can think of is to "touch" the file, so the |
fixed it! grr, it was actually to do with the path normalisations; sphinx fails if there are any Anyway it all works now |
Phew, that's a relief. Good to know that it isn't the transform that breaks stuff. Something is broken with logging in to circleci for me (complete with 500 errors from github)—can you please share a link to the build artifacts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, all looks good!
thanks @akhmerov, perhaps a new release is in order 😬 ? (I guess bumping to v0.3.0, since we dropped sphinx 1.8 compatibility) |
Sounds fair, would you mind doing a quick alpha release though (as we did before), so I can use it in my repository? |
Will do once I have some time (dense schedule with exams). Or @choldgraf if you could do that, it'd be also great! |
I just cut https://github.com/jupyter/jupyter-sphinx/releases/tag/v0.3.0a1 which I think will push the alpha release? @chrisjsewell lemme know if I messed something up |
Cheers will do |
This PR makes
jupyter-download
act equivalently to the standarddownload
role and fixes a bug when supplying relative paths.See the added test for an example of how this works, but basically you can now include alternative caption text:
:jupyter-download:notebook:`alternative text <../path/to/a/notebook>`
.I also added
jupyter-download:nb
as an alternative name, becausejupyter-download:notebook
is a mouthful!