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

add option for zip downloads #1299

Merged
merged 14 commits into from May 24, 2024

Conversation

jamiecook
Copy link
Contributor

Our IT department prevents downloads of .py and .ipynb files.

This PR adds an option (documented) that allows for generating .py.zip and .ipynb.zip files instead.

@larsoner
Copy link
Contributor

larsoner commented Apr 29, 2024

If this is a common enough use case -- that people's internet is restricted -- we should probably make all projects that use SG expose a .zip way of downloading files. In this sense it's a bit odd to make it a project-specific config value. We also already have too many config options, so it would be nice to avoid adding another.

So perhaps rather than a separate config option we could add a third download "entry" for all projects that use SG:

  • Download Jupyter notebook: 10_overview.ipynb
  • Download Python source code: 10_overview.py
  • Download both in a zip archive: 10_overview.zip

That way people who can download directly still can, and people who have more restricted access can get what they need. I understand this is slightly less flexible in that people who have restricted access have to "download both" in all cases, but I think it's an acceptable tradeoff for those folks to have to (very easily!) delete the one small extra file they get once extracting, or more carefully just extract the one file that they want. The .zips should be tiny so no appreciable bandwidth/size problem should come from this either I think.

And if there are projects that hate this new .zip option, as long as we have it in part of its own CSS class, people can set visibility: hidden to make it go away.

@jamiecook
Copy link
Contributor Author

Thats a good idea - I will modify and resubmit

@jamiecook
Copy link
Contributor Author

@larsoner that is done, much smaller delta on this one now

image

sphinx_gallery/gen_rst.py Outdated Show resolved Hide resolved
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
@jamiecook
Copy link
Contributor Author

I think this one just needs approval to run all the other CI workflows.

@larsoner larsoner merged commit d240382 into sphinx-gallery:master May 24, 2024
17 checks passed
@larsoner
Copy link
Contributor

Thanks @jamiecook !

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

Successfully merging this pull request may close these issues.

None yet

3 participants