Skip to content

Commit 4365a1b

Browse files
authored
Add new docs dependency: sphinx-autobuild. Add livehtml cmd in makefile. Update documentation with new contribution instructions for building documentation. (#31)
- Add new docs dependency: sphinx-autobuild - Add livehtml cmd to makefile - Update documentation with new contribution instructions for building documentation.
1 parent afb0f24 commit 4365a1b

File tree

5 files changed

+273
-10
lines changed

5 files changed

+273
-10
lines changed

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ help:
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
livehtml:
23+
uv run sphinx-autobuild -b dirhtml --pre-build "rm -rf $(BUILDDIR)" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"awesome_external_links": True,
7171
"main_nav_links": {
72-
"Home": "https://judge0.github.io/judge0-python/",
72+
"Home": "index",
7373
"Judge0": "https://judge0.com/",
7474
},
7575
}

docs/source/contributors_guide/contributing.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,21 @@ Preparing the development setup
3939
Building documentation
4040
----------------------
4141

42-
Documentation is built using Sphinx. To build the documentation, run the
42+
Documentation is built using Sphinx. While working on a documentation, you can run
4343

4444
.. code-block:: console
4545
4646
$ cd docs
47-
$ make html
47+
$ make livehtml
4848
49-
You should inspect the changes in the documentation by opening the
50-
``docs/build/html/index.html`` file in your browser.
49+
The ``make livehtml`` command will start a live HTTP server, watch the `docs` directory for changes,
50+
and rebuild the documentation on every change, enabling you to continuously work on the documentation,
51+
without having to manually rebuild it after every change.
5152

52-
.. note::
53-
If you are having trouble with the documentation and are seeing unexpected
54-
output, delete the ``docs/build`` directory and rerun the ``make html`` command.
53+
You can inspect the changes by opening the ``http://localhost:8000`` in your browser.
5554

56-
You'll see a different output since the documentation is build with
57-
`sphinx-multiversion <https://github.com/sphinx-contrib/multiversion>`_ extension.
55+
.. You'll see a different output since the documentation is build with
56+
.. `sphinx-multiversion <https://github.com/sphinx-contrib/multiversion>`_ extension.
5857
5958
Testing
6059
-------

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ docs = [
4848
"sphinxawesome-theme==5.3.2",
4949
"sphinx-autodoc-typehints==2.3.0",
5050
"sphinx-multiversion==0.2.4",
51+
"sphinx-autobuild>=2024.10.3",
5152
]
5253
dev = [{ include-group = "test" }, { include-group = "docs" }]
5354

0 commit comments

Comments
 (0)