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

Docs: Add make htmllive to rebuild and reload HTML files in your browser #111900

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Nov 9, 2023

Add a make htmllive target to use https://github.com/executablebooks/sphinx-autobuild.

When you run it, it builds the docs and serves them at something like http://127.0.0.1:8000/

You can visit any page, for example http://127.0.0.1:8000/pep-0101.html, and when you edit/save your source .rst file, it will automatically rebuild and update the page in the browser.

This drastically improves the edit/inspect loop. A very nice touch is it will also keep you at the same position in the page.

Compare before:

  1. switch to IDE: edit, save
  2. switch to prompt: make html
  3. switch to browser: reload, inspect
  4. repeat

To this PR:

  1. switch to IDE: edit, save
  2. switch to prompt: make html
  3. switch to browser: reload, inspect
  4. repeat

We've already added this to the devguide (python/devguide#1208, python/devguide#1212) and have an open PR for the PEPs: python/peps#3521.

cc @pradyunsg


📚 Documentation preview 📚: https://cpython-previews--111900.org.readthedocs.build/

@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes docs Documentation in the Doc dir and removed awaiting core review labels Nov 9, 2023
@hugovk hugovk changed the title Add make htmllive to rebuild and reload HTML files in your browser Docs: Add make htmllive to rebuild and reload HTML files in your browser Nov 9, 2023
@hugovk hugovk merged commit a430b4f into python:main Nov 13, 2023
26 checks passed
@hugovk hugovk deleted the docs-make-htmllive branch November 13, 2023 08:06
@miss-islington-app
Copy link

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @hugovk, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a430b4ffdd9b8f32e53140e4d4450691d980c0c9 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2023
…owser (pythonGH-111900)

(cherry picked from commit a430b4f)

Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 13, 2023

GH-112022 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 13, 2023
hugovk added a commit that referenced this pull request Nov 13, 2023
hugovk added a commit to hugovk/cpython that referenced this pull request Nov 13, 2023
…your browser (pythonGH-111900).

(cherry picked from commit a430b4f)

Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 13, 2023

GH-112023 is a backport of this pull request to the 3.11 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant