Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change adds a time estimation feature for all tutorials in the documentation. This is achieved by creating a custom Sphinx extension that calculates the median reading time for each tutorial and displays it at the top of the page.


PR created automatically by Jules for task 12561959496377524413

This commit adds a time estimation feature for all tutorials in the documentation. This is achieved by creating a custom Sphinx extension that calculates the median reading time for each tutorial and displays it at the top of the page.

The following changes were made:
- Created a new Sphinx extension `sphinx_time_estimation.py` to calculate the reading time.
- Created a new module `custom_gallery.py` to override the default `sphinx-gallery` behavior and display the reading time.
- Modified `docs/source/conf.py` to include the new extension and module.
- Fixed the build errors and verified that the changes are working as expected.
This commit adds a time estimation feature for all tutorials in the documentation. This is achieved by creating a custom Sphinx extension that calculates the median reading time for each tutorial and displays it at the top of the page.

The following changes were made:
- Created a new Sphinx extension `sphinx_time_estimation.py` to calculate the reading time.
- Created a new module `custom_gallery.py` to override the default `sphinx-gallery` behavior and display the reading time.
- Modified `docs/source/conf.py` to include the new extension and module.
- Fixed the build errors and verified that the changes are working as expected.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@bruAristimunha bruAristimunha marked this pull request as ready for review October 2, 2025 07:36
@bruAristimunha
Copy link
Collaborator

@jules fix the pre commit

@google-labs-jules
Copy link
Contributor Author

@jules fix the pre commit

I have fixed the pre-commit errors by correcting the reStructuredText formatting in the tutorial files. The documentation now builds without any errors.

google-labs-jules bot and others added 4 commits October 2, 2025 08:02
This commit refactors the time estimation feature to use Sphinx's templating system instead of monkey-patching `sphinx-gallery`. This approach is more robust and maintainable.

The following changes were made:
- Removed the `custom_gallery.py` file and the corresponding import from `conf.py`.
- Updated `sphinx_time_estimation.py` to correctly traverse the `doctree` and exclude code blocks from the word count.
- Created a new `page.html` template to display the estimated reading time.
- Corrected reStructuredText formatting in tutorial files to resolve build errors.
@bruAristimunha bruAristimunha changed the title Add time estimation for tutorials [DOC] Add time estimation for tutorials Oct 4, 2025
@bruAristimunha bruAristimunha merged commit bb94115 into develop Oct 4, 2025
8 checks passed
@bruAristimunha bruAristimunha deleted the feature/time-estimation branch October 4, 2025 23:19
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

Successfully merging this pull request may close these issues.

2 participants