From 967643959f0a6f5351e4fdeb48cf935d787e4e6a Mon Sep 17 00:00:00 2001 From: SnippyCodes Date: Sat, 13 Jun 2026 11:29:05 +0530 Subject: Fixed #37157 -- Doc'd usage of sphinx-autobuild for documentation auto-reloading. --- .../contributing/writing-documentation.txt | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/internals/contributing/writing-documentation.txt b/docs/internals/contributing/writing-documentation.txt index a9fa1a0267..cbbe611d7c 100644 --- a/docs/internals/contributing/writing-documentation.txt +++ b/docs/internals/contributing/writing-documentation.txt @@ -142,6 +142,51 @@ will be themed differently than the documentation at `docs.djangoproject.com `_. This is OK! If your changes look good on your local machine, they'll look good on the website. +Automating documentation rebuilds +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:pypi:`sphinx-autobuild` can be used to automatically rebuild the documentation +and reload the documentation page in the browser whenever a file changes. To +enable auto-reloading: + +1. Install the package: + + .. console:: + + $ python -m pip install sphinx-autobuild + +2. From the ``docs`` directory, run one of the following commands: + + * On Linux and macOS: + + .. code-block:: shell + + $ SPHINXBUILD=sphinx-autobuild SPHINXOPTS="--open-browser --delay 0" make html + + * On Windows (Command Prompt): + + .. code-block:: doscon + + ...\> set SPHINXBUILD=sphinx-autobuild + ...\> set SPHINXOPTS=--open-browser --delay 0 + ...\> make html + + * On Windows (PowerShell): + + .. code-block:: powershell + + PS> $env:SPHINXBUILD="sphinx-autobuild" + PS> $env:SPHINXOPTS="--open-browser --delay 0" + PS> make html + + Alternatively, ``sphinx-autobuild`` can be invoked directly: + + .. console:: + + $ sphinx-autobuild . _build/html --open-browser --delay 0 + +The auto-reloader can be stopped with ``Ctrl+C``. + Making edits to the documentation --------------------------------- -- cgit v1.3