Skip to content

Add make [-C docs] htmllive to rebuild and reload HTML files #8913

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

Merged
merged 6 commits into from
Apr 19, 2025

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Apr 18, 2025

The existing make livehtml uses https://github.com/lepture/python-livereload and builds the docs and opens them in the browser, but if I edit an RST file, it doesn't rebuild the file and reload the site.

Let's replace it with make htmllive which uses https://github.com/sphinx-doc/sphinx-autobuild, and does the same as above, but also rebuilds changed RST files and reloads the browser.

This is what is used in CPython docs (and devguide and PEPs) and it's great to use. So I used the same htmllive target name because I'm used to typing it. I guess no-one has been using the old livehtml target in a while, as we've not noticed it working.

I added sphinx-autobuild to the list of optional docs dependencies. We could only install this when doing a livehtml build, but it's easier to always install it. Happy to change if preferred.

Also deleted docs/Guardfile, I don't think it's needed?

Co-authored-by: Andrew Murray <[email protected]>
Co-authored-by: Andrew Murray <[email protected]>
Comment on lines 22 to +23
@echo " htmlview to open the index page built by the html target in your browser"
@echo " htmllive to rebuild and reload HTML files in your browser"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@echo " htmlview to open the index page built by the html target in your browser"
@echo " htmllive to rebuild and reload HTML files in your browser"
@echo " htmllive to rebuild and reload HTML files in your browser"
@echo " htmlview to open the index page built by the html target in your browser"

If you, and you may not, make the other suggested change to be alphabetical, maybe this group of html* targets should be in the same order?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's keep this as is -- it's going from simpler action to more complex.

And actually, I'll revert the change to the top-level Makefile too.

hugovk and others added 2 commits April 19, 2025 23:12
Co-authored-by: Andrew Murray <[email protected]>
This reverts commit 7da1715.
@hugovk hugovk merged commit 03e7871 into python-pillow:main Apr 19, 2025
68 checks passed
@hugovk hugovk deleted the sphinx-autobuild branch April 19, 2025 21:18
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