Skip to content

Commit 995e1ca

Browse files
committed
Enable version switcher in local build
1 parent 41ce51b commit 995e1ca

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

dev/tasks/tasks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,7 @@ tasks:
12151215
params:
12161216
env:
12171217
JDK: 17
1218+
DOCS_DEV: "1"
12181219
pr_number: Unset
12191220
image: debian-docs
12201221
publish: true

docs/source/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,15 @@
328328
# documentation.
329329
#
330330

331+
# To enable the version switcher during a local build, set the
332+
# environment variable DOCS_DEV to "1".
333+
docs_dev = os.environ.get("DOCS_DEV", "0")
334+
json_url = "/docs/_static/versions.json"
335+
336+
if docs_dev == "1":
337+
json_url = "https://arrow.apache.org/docs/_static/versions.json"
338+
# json_url = "_static/versions.json"
339+
331340
switcher_version = version
332341
if ".dev" in version:
333342
switcher_version = "dev/"
@@ -365,7 +374,7 @@
365374
],
366375
"show_version_warning_banner": True,
367376
"switcher": {
368-
"json_url": "/docs/_static/versions.json",
377+
"json_url": json_url,
369378
"version_match": switcher_version,
370379
},
371380
}

docs/source/developers/documentation.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ These two steps are mandatory and must be executed in order.
8787
not sufficiently comprehensive. Portions of the Python API documentation
8888
will also not build without CUDA support having been built.
8989

90+
.. note::
91+
92+
To enable the version switcher in a local documentation build, set the
93+
environment variable ``DOCS_DEV=1`` before building, or run the build
94+
command with it inline, for example: ``DOCS_DEV=1 make html``.
95+
9096
After these steps are completed, the documentation is rendered in HTML
9197
format in ``arrow/docs/_build/html``. In particular, you can point your browser
9298
at ``arrow/docs/_build/html/index.html`` to read the docs and review any changes

0 commit comments

Comments
 (0)