andygrove commented on code in PR #2170:
URL: https://github.com/apache/datafusion-comet/pull/2170#discussion_r2280899193
##########
docs/Makefile:
##########
@@ -19,20 +19,25 @@
# Minimal makefile for Sphinx documentation
#
-# You can set these variables from the command line, and also
-# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
-# Put it first so that "make" without argument is like "make help".
+# Extract version from Cargo.toml (default)
+PROJECT_VERSION := $(shell grep '^version' ../native/Cargo.toml | head -1 |
cut -d '"' -f2)
+
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-.PHONY: help Makefile
+html:
+ @echo "Building docs for version $(PROJECT_VERSION)"
+ @PROJECT_VERSION=$(PROJECT_VERSION) $(SPHINXBUILD) -b html
"$(SOURCEDIR)" "$(BUILDDIR)/html"
-# Catch-all target: route all unknown targets to Sphinx using the new
-# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+# Build docs and copy into versioned dir (like Spark does)
+publish: html
+ @mkdir -p site/docs/$(PROJECT_VERSION)
+ @cp -r $(BUILDDIR)/html/* site/docs/$(PROJECT_VERSION)/
+ @rm -rf site/docs/latest
+ @ln -s $(PROJECT_VERSION) site/docs/latest
+ @echo "Docs published under site/docs/$(PROJECT_VERSION) and
site/docs/latest"
Review Comment:
This PR will result in all current content being deleted, so users visiting
https://datafusion.apache.org/comet/ will get a 404 error. We'll need to think
about the best way to handle that. Perhaps we need to set up redirects for
current content to redirect to `/latest`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]