Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ run the following command:

make html

On Windows, use:

.. code:: bat

make.bat html

The documentation will be generated in the ``_build/html/`` directory
and are viewable in a web browser, for instance by opening the local
``_build/html/index.html`` file.
Expand All @@ -320,6 +326,12 @@ specific examples, you can use the following command with a regex pattern:

make html EXAMPLES_PATTERN=your_regex_goes_here

On Windows, use:

.. code:: bat

make.bat html EXAMPLES_PATTERN=your_regex_goes_here

This is especially helpful when you're only modifying or checking a few examples.

It is also possible to build the documentation without running the examples
Expand All @@ -329,6 +341,12 @@ without running the examples by using the following command:

make html-noplot

On Windows, use:

.. code:: bat

make.bat html-noplot

This command generates the documentation without re-executing the examples, which can
take a long time. This is useful if you are only modifying the documentation itself, such as fixing
typos or improving explanations.
Expand Down
3 changes: 1 addition & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ linkcheck-noplot:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf _build/ reference/generated/
rm -rf _build/ generated_for_index
rm -rf _build/ auto_examples/ generated/ generated_for_index/ reference/generated/
rm -f reference/*.rst
96 changes: 96 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@ECHO OFF
setlocal
REM Command file for Sphinx documentation (skrub)

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set SOURCEDIR=.
set ALLSPHINXOPTS=-d "%BUILDDIR%/doctrees" %SPHINXOPTS% "%SOURCEDIR%"

if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)

if NOT "%EXAMPLES_PATTERN%" == "" (
set ALLSPHINXOPTS=-D sphinx_gallery_conf.filename_pattern=%EXAMPLES_PATTERN% %ALLSPHINXOPTS%
)

if "%1" == "" goto html-noplot
if "%1" == "help" goto help
if "%1" == "clean" goto clean
if "%1" == "html" goto html
if "%1" == "html-noplot" goto html-noplot
if "%1" == "linkcheck" goto linkcheck
if "%1" == "linkcheck-noplot" goto linkcheck-noplot

echo.Unknown target "%1", use "make.bat help" for available targets.
goto end

:help
echo.Please use make.bat ^<target^> where ^<target^> is one of
echo. html to make standalone HTML files
echo. html-noplot to make HTML files without plotting the gallery
echo. linkcheck to check all external links for integrity
echo. linkcheck-noplot to check links without plotting the gallery
echo. clean to remove all build output
goto end

:clean
if exist "%BUILDDIR%\" (
rmdir /q /s "%BUILDDIR%"
echo. Removed %BUILDDIR%\
)
if exist "auto_examples\" (
rmdir /q /s "auto_examples"
echo. Removed auto_examples\
)
if exist "generated\" (
rmdir /q /s "generated"
echo. Removed generated\
)
if exist "reference\generated\" (
rmdir /q /s "reference\generated"
echo. Removed reference\generated\
)
if exist "generated_for_index\" (
rmdir /q /s "generated_for_index"
echo. Removed generated_for_index\
)
if exist "reference\" (
for %%i in ("reference\*.rst") do del /q "%%i" 2>nul
echo. Removed reference\*.rst
)
goto end
Comment on lines +41 to +65

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed that more files are being cleaned here than in the original makefile. That's good! Could you update the linux makefile to match?


:html
if exist "%BUILDDIR%\html\_images\" (
rmdir /q /s "%BUILDDIR%\html\_images"
)
set SKB_TABLE_REPORT_VERBOSITY=0
%SPHINXBUILD% -b html %ALLSPHINXOPTS% "%BUILDDIR%/html"
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end

:html-noplot
set SKB_TABLE_REPORT_VERBOSITY=0
%SPHINXBUILD% -D plot_gallery=0 -b html %ALLSPHINXOPTS% "%BUILDDIR%/html"
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end

:linkcheck
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% "%BUILDDIR%/linkcheck"
echo.
echo.Linkcheck finished. Results are in %BUILDDIR%/linkcheck.
goto end

:linkcheck-noplot
%SPHINXBUILD% -D plot_gallery=0 -b linkcheck %ALLSPHINXOPTS% "%BUILDDIR%/linkcheck-noplot"
echo.
echo.Linkcheck (no plot) finished. Results are in %BUILDDIR%/linkcheck-noplot.
goto end

:end
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,17 @@ python = "~=3.14.0"
[tool.pixi.feature.doc.tasks]
build-doc = { cmd = "make html", cwd = "doc" }
build-doc-quick = { cmd = "make html-noplot", cwd = "doc" }
clean-doc = { cmd = "rm -rf _build/ && rm -rf auto_examples/ && rm -rf reference/generated/", cwd = "doc" }
clean-doc = { cmd = "rm -rf _build/ && rm -rf auto_examples/ && rm -rf generated/ && rm -rf generated_for_index/ && rm -rf reference/generated/", cwd = "doc" }
Comment thread
DCchoudhury15 marked this conversation as resolved.
Outdated
linkcheck = { cmd = "make linkcheck", cwd = "doc" }
linkcheck-quick = { cmd = "make linkcheck-noplot", cwd = "doc" }

[tool.pixi.feature.doc.target.win-64.tasks]
build-doc = { cmd = ".\\make.bat html", cwd = "doc" }
build-doc-quick = { cmd = ".\\make.bat html-noplot", cwd = "doc" }
clean-doc = { cmd = ".\\make.bat clean", cwd = "doc" }
linkcheck = { cmd = ".\\make.bat linkcheck", cwd = "doc" }
linkcheck-quick = { cmd = ".\\make.bat linkcheck-noplot", cwd = "doc" }


[tool.pixi.feature.lint.tasks]
lint = { cmd = "pre-commit install && pre-commit run -v --all-files --show-diff-on-failure" }
Expand Down
Loading