Skip to content

Commit 4ccc11f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into finish-2193
2 parents 8056acc + 7939a75 commit 4ccc11f

6 files changed

Lines changed: 128 additions & 37 deletions

File tree

doc/Makefile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,47 @@ html:
2828
# the embedding of images more robust
2929
rm -rf $(BUILDDIR)/html/_images
3030
#rm -rf _build/doctrees/
31-
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
31+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
32+
# Build markdown sources so llms.txt links point to .md files
33+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
34+
cp -r $(BUILDDIR)/markdown/. $(BUILDDIR)/html/_sources/
3235
@echo
3336
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3437

3538
html-noplot:
36-
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
39+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
40+
# Build markdown sources so llms.txt links point to .md files
41+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -D plot_gallery=0 -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
42+
cp -r $(BUILDDIR)/markdown/. $(BUILDDIR)/html/_sources/
43+
@echo
44+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
45+
46+
html-quick:
47+
# Only build the HTML pages, skipping the markdown build and copying of sources
48+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
3749
@echo
3850
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3951

4052
linkcheck:
41-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
53+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
4254
@echo
4355
@echo "Linkcheck finished. Results are in $(BUILDDIR)/linkcheck."
4456

4557
linkcheck-noplot:
46-
$(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck-noplot
58+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck-noplot
4759
@echo
4860
@echo "Linkcheck (no plot) finished. Results are in $(BUILDDIR)/linkcheck-noplot."
4961

62+
markdown:
63+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
64+
@echo
65+
@echo "Markdown build finished. The markdown files are in $(BUILDDIR)/markdown."
66+
67+
markdown-noplot:
68+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
69+
@echo
70+
@echo "Markdown build (no plot) finished. The markdown files are in $(BUILDDIR)/markdown."
71+
5072
# Catch-all target: route all unknown targets to Sphinx using the new
5173
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
5274
%: Makefile

doc/conf.py

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@
2424

2525
import jinja2
2626

27+
# -- Copy files for docs --------------------------------------------------
28+
#
29+
# We avoid duplicating the information, but we do not use symlinks to be
30+
# able to build the docs on Windows
31+
shutil.copyfile("../RELEASE_PROCESS.rst", "RELEASE_PROCESS.rst")
32+
shutil.copyfile("../CHANGES.rst", "CHANGES.rst")
33+
shutil.copyfile("../CONTRIBUTING.rst", "CONTRIBUTING.rst")
34+
35+
# Allow skipping jupyterlite to speed up builds (e.g. html-noplot)
36+
_SKIP_JUPYTERLITE = os.environ.get("SKIP_JUPYTERLITE", "").strip() in (
37+
"1",
38+
"true",
39+
"yes",
40+
)
41+
2742
# Generate the table report html file for the homepage
2843
sys.path.append(os.path.relpath("."))
2944
from data_ops_report import create_data_ops_report
@@ -43,14 +58,6 @@
4358
from github_link import make_linkcode_resolve
4459
from sphinx_gallery.notebook import add_code_cell, add_markdown_cell
4560

46-
# -- Copy files for docs --------------------------------------------------
47-
#
48-
# We avoid duplicating the information, but we do not use symlinks to be
49-
# able to build the docs on Windows
50-
shutil.copyfile("../RELEASE_PROCESS.rst", "RELEASE_PROCESS.rst")
51-
shutil.copyfile("../CHANGES.rst", "CHANGES.rst")
52-
shutil.copyfile("../CONTRIBUTING.rst", "CONTRIBUTING.rst")
53-
5461
# -- General configuration ------------------------------------------------
5562

5663
# If your documentation needs a minimal Sphinx version, state it here.
@@ -76,27 +83,36 @@
7683
"sphinx_copybutton",
7784
"sphinx_gallery.gen_gallery",
7885
"autoshortsummary",
86+
"sphinx_llms_txt",
87+
"sphinx_markdown_builder",
7988
]
8089

90+
# -- sphinx-llms-txt configuration -------------------------------------------
91+
# Link to Markdown sources in _sources/ (generated by the markdown builder).
92+
llms_txt_uri_template = "{base_url}_sources/{docname}.md"
93+
8194
try:
8295
import sphinxext.opengraph # noqa
8396

8497
extensions.append("sphinxext.opengraph")
8598
except ImportError:
8699
print("ERROR: sphinxext.opengraph import failed")
87100

88-
try:
89-
import jupyterlite_sphinx # noqa: F401
90-
91-
extensions.append("jupyterlite_sphinx")
92-
with_jupyterlite = True
93-
except ImportError:
94-
# In some cases we don't want to require jupyterlite_sphinx to be installed,
95-
# e.g. the doc-min-dependencies build
96-
warnings.warn(
97-
"jupyterlite_sphinx is not installed, you need to install it "
98-
"if you want JupyterLite links to appear in each example"
99-
)
101+
if not _SKIP_JUPYTERLITE:
102+
try:
103+
import jupyterlite_sphinx # noqa: F401
104+
105+
extensions.append("jupyterlite_sphinx")
106+
with_jupyterlite = True
107+
except ImportError:
108+
# In some cases we don't want to require jupyterlite_sphinx to be installed,
109+
# e.g. the doc-min-dependencies build
110+
warnings.warn(
111+
"jupyterlite_sphinx is not installed, you need to install it "
112+
"if you want JupyterLite links to appear in each example"
113+
)
114+
with_jupyterlite = False
115+
else:
100116
with_jupyterlite = False
101117

102118
import sphinx_autosummary_accessors

pixi.lock

Lines changed: 52 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ dev = [
6363
"sphinx-copybutton",
6464
"sphinx-gallery",
6565
"sphinxext-opengraph",
66+
"sphinx-llms-txt",
67+
"sphinx-markdown-builder",
6668
"sphinx-autosummary-accessors",
6769
"statsmodels",
6870

@@ -124,6 +126,8 @@ sphinx-gallery = "*"
124126
sphinxext-opengraph = "*"
125127
sphinx-autosummary-accessors = ">=2025.3.1,<2026"
126128
sphinx-sitemap = "*"
129+
sphinx-llms-txt = "*"
130+
sphinx-markdown-builder = "*"
127131
statsmodels = "*"
128132
optuna = "*"
129133
skorch = "*"
@@ -221,7 +225,8 @@ python = "~=3.14.0"
221225

222226
[tool.pixi.feature.doc.tasks]
223227
build-doc = { cmd = "make html", cwd = "doc" }
224-
build-doc-quick = { cmd = "make html-noplot", cwd = "doc" }
228+
build-doc-no-plot = { cmd = "make html-no-plot", cwd = "doc" }
229+
build-doc-quick = { cmd = "make html-quick", cwd = "doc" }
225230
clean-doc = { cmd = "make clean", cwd = "doc" }
226231
linkcheck = { cmd = "make linkcheck", cwd = "doc" }
227232
linkcheck-quick = { cmd = "make linkcheck-noplot", cwd = "doc" }
@@ -278,6 +283,7 @@ exclude = [
278283
"dist",
279284
"doc/_build",
280285
"doc/auto_examples",
286+
"skrub/_docs/*.py",
281287
"build",
282288
"pixi.lock",
283289
]
@@ -364,6 +370,7 @@ xfail_strict = true
364370
addopts = ["--doctest-modules", "--strict-config", "--strict-markers"]
365371
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
366372

373+
367374
[tool.codespell]
368375
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
369376
skip = '.git*,*.svg,package-lock.json,*.lock,*.css,*-min.*,pyproject.toml'

0 commit comments

Comments
 (0)