Refactoring of docs/Makefile
This commit is contained in:
parent
fd8ee949a8
commit
ddd3e2234c
1 changed files with 41 additions and 29 deletions
|
|
@ -17,7 +17,11 @@ EVGAMEDIR ?= $(realpath ../../gamedir)
|
||||||
help:
|
help:
|
||||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
@echo "Evennia-specific: "
|
@echo "Evennia-specific: "
|
||||||
@echo " release - build and prepare multiversion docs and auto-docs for release."
|
@echo " install - get build requirements"
|
||||||
|
@echo " clean - remove remnants of a previous build"
|
||||||
|
@echo " local - build local html docs of the current branch (no multiversion)."
|
||||||
|
@echo " mv-local - build full multiversion html docs, without deploying (req. all changes committed to git)"
|
||||||
|
@echo " release - build and deploy multiversion docs online (req. github push access)"
|
||||||
|
|
||||||
.PHONY: help Makefile
|
.PHONY: help Makefile
|
||||||
|
|
||||||
|
|
@ -28,47 +32,55 @@ help:
|
||||||
|
|
||||||
# Evennia - custom commands
|
# Evennia - custom commands
|
||||||
|
|
||||||
|
# helper targets
|
||||||
|
|
||||||
|
_check-env:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh
|
||||||
|
|
||||||
|
_multiversion-check-env:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh multiversion
|
||||||
|
|
||||||
|
_autodoc-index:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
|
||||||
|
|
||||||
|
_multiversion-autodoc-index:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
|
||||||
|
git diff-index --quiet HEAD || git commit -a -m "Updated API autodoc index."
|
||||||
|
|
||||||
|
_build:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
||||||
|
|
||||||
|
_multiversion-build:
|
||||||
|
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
||||||
|
|
||||||
|
_multiversion-deploy:
|
||||||
|
@bash -e deploy.sh
|
||||||
|
|
||||||
|
# main targets
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@pip install -r requirements.txt
|
@pip install -r requirements.txt
|
||||||
|
|
||||||
# build / update only the api-autodoc index
|
|
||||||
autodoc-index:
|
|
||||||
@sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
|
|
||||||
|
|
||||||
api-build:
|
|
||||||
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html/api"
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -Rf $(BUILDDIR)
|
@rm -Rf $(BUILDDIR)
|
||||||
@git clean -f -d docs/
|
@git clean -f -d docs/
|
||||||
@echo "Cleaned old build dir and leftover files."
|
@echo "Cleaned old build dir and leftover files."
|
||||||
|
|
||||||
|
local:
|
||||||
# multiversion release builds
|
make _check-env
|
||||||
|
make clean
|
||||||
mv-check-env:
|
make _autodoc_index
|
||||||
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh multiversion
|
make _build
|
||||||
|
|
||||||
# we must commit the index before it's made available to multiversion
|
|
||||||
mv-autodoc-index:
|
|
||||||
@sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
|
|
||||||
git diff-index --quiet HEAD || git commit -a -m "Updated API autodoc index."
|
|
||||||
|
|
||||||
multiversion-build:
|
|
||||||
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
|
||||||
|
|
||||||
mv-deploy:
|
|
||||||
@bash -e deploy.sh
|
|
||||||
|
|
||||||
mv-local:
|
mv-local:
|
||||||
make mv-check-env
|
make _multiversion-check-env
|
||||||
make clean
|
make clean
|
||||||
make mv-autodoc-index
|
make _multiversion-autodoc-index
|
||||||
make multiversion-build
|
make _multiversion-build
|
||||||
|
|
||||||
# build and prepare the docs for release
|
# build and prepare the docs for release
|
||||||
mv-release:
|
release:
|
||||||
make mv-local
|
make mv-local
|
||||||
# make mv-deploy
|
# make _mv-deploy
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Deployment complete."
|
@echo "Deployment complete."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue