File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 19
19
# Minimal makefile for Sphinx documentation
20
20
#
21
21
22
- # You can set these variables from the command line, and also
23
- # from the environment for the first two.
24
22
SPHINXOPTS ?=
25
23
SPHINXBUILD ?= sphinx-build
26
24
SOURCEDIR = source
27
25
BUILDDIR = build
28
26
29
- # Put it first so that "make" without argument is like "make help".
27
+ # Extract version from Cargo.toml (default)
28
+ PROJECT_VERSION := $(shell grep '^version' ../native/Cargo.toml | head -1 | cut -d '"' -f2)
29
+
30
30
help :
31
31
@$(SPHINXBUILD ) -M help " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
32
32
33
- .PHONY : help Makefile
33
+ html :
34
+ @echo " Building docs for version $( PROJECT_VERSION) "
35
+ @PROJECT_VERSION=$(PROJECT_VERSION ) $(SPHINXBUILD ) -b html " $( SOURCEDIR) " " $( BUILDDIR) /html"
34
36
35
- # Catch-all target: route all unknown targets to Sphinx using the new
36
- # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
37
- % : Makefile
38
- @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
37
+ # Build docs and copy into versioned dir (like Spark does)
38
+ publish : html
39
+ @mkdir -p site/docs/$(PROJECT_VERSION )
40
+ @cp -r $(BUILDDIR ) /html/* site/docs/$(PROJECT_VERSION ) /
41
+ @rm -rf site/docs/latest
42
+ @ln -s $(PROJECT_VERSION ) site/docs/latest
43
+ @echo " Docs published under site/docs/$( PROJECT_VERSION) and site/docs/latest"
You can’t perform that action at this time.
0 commit comments