Skip to content

Conversation

@0xsatoshi99
Copy link

Summary

Enables download buttons for all PyTorch tutorials, addressing the 5-year-old request in issue #712 for offline access.

Problem

Users wanted to access PyTorch tutorials offline (e.g., before flights) without having to:

  • Build the entire repository locally (time-consuming)
  • Rely on constant internet connection
  • Navigate complex build processes

Solution

One-line fix: Enable download_all_examples in Sphinx gallery configuration

Change: conf.py line 177

# Before
"download_all_examples": False,

# After
"download_all_examples": True,

Benefits

  1. Offline Access: Users can download tutorials for offline viewing
  2. Improved Accessibility: No internet required after initial download
  3. Better UX: Standard feature in most documentation sites
  4. Easy Sharing: Users can share tutorial files directly
  5. No Build Required: Direct access without local build setup

What This Enables

When enabled, each tutorial page will have download buttons for:

  • .py (Python source file)
  • .ipynb (Jupyter notebook)
  • .zip (complete example with assets)

Users can click these buttons to download tutorials for offline use.

Testing

This is a Sphinx Gallery configuration option that:

  • ✅ Is well-documented and stable
  • ✅ Used by many other documentation sites
  • ✅ Requires no code changes, only config
  • ✅ Automatically generates download links during build

Impact

  • No breaking changes: Only adds functionality
  • No performance impact: Downloads are optional
  • Improves accessibility: Especially for users with limited connectivity

Related

Fixes #712

Enables the download_all_examples feature in Sphinx gallery configuration
to allow users to download tutorials for offline access.

Issue:
Users requested the ability to access PyTorch tutorials offline (e.g., before
flights) without having to build the entire repository locally, which takes
a long time.

Solution:
Changed download_all_examples from False to True in conf.py. This enables
download buttons on all tutorial pages, allowing users to:
- Download individual tutorial files
- Access tutorials offline
- Save tutorials for later reference

Benefits:
- Improves accessibility for users with limited internet
- Enables offline learning and development
- Reduces barrier to entry (no need to build repo)
- Aligns with common documentation practices

This is a simple one-line configuration change that significantly improves
user experience for offline access to PyTorch tutorials.

Fixes pytorch#712
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 31, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3630

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit cbc683c with merge base 9dc8613 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla
Copy link

meta-cla bot commented Oct 31, 2025

Hi @0xsatoshi99!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link

meta-cla bot commented Oct 31, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the cla signed label Oct 31, 2025
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Download button

2 participants