Changes to docs setup

This commit is contained in:
Griatch 2020-04-05 13:00:01 +02:00
parent d5b91a1bf3
commit c1dafcb3fa
3 changed files with 66 additions and 31 deletions

View file

@ -7,6 +7,7 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build SPHINXBUILD ?= sphinx-build
SOURCEDIR = source SOURCEDIR = source
BUILDDIR = build BUILDDIR = build
AUTODOCDIR = $(SOURCEDIR)/api
EVDIR ?= $(realpath ../evennia) EVDIR ?= $(realpath ../evennia)
EVGAMEDIR ?= $(realpath ../../gamedir) EVGAMEDIR ?= $(realpath ../../gamedir)
@ -23,48 +24,51 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile
make help @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Evennia - custom commands # Evennia - custom commands
install: install:
@pip install -r requirements.txt @pip install -r requirements.txt
check-env: # build / update only the api-autodoc index
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh
# build only the api-autodoc index
autodoc-index: autodoc-index:
@sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR) @sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
api-build: api-build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html/api" @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html/api"
clean:
@rm -Rf $(BUILDDIR)
@git clean -f -d docs/
@echo "Cleaned old build dir and leftover files."
# multiversion release builds
mv-check-env:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh multiversion
# we must commit the index before it's made available to multiversion
mv-autodoc-index:
@sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
git commit -a -m "Updated API autodoc index."
multiversion-build: multiversion-build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html" @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html"
clean: mv-deploy:
@rm -Rf $(BUILDDIR)
@git clean -f -d
@echo "Cleaned old build dir and leftover files."
local:
make check-env
make clean
make autodoc-index
make multiversion-build
deploy:
@bash -e deploy.sh @bash -e deploy.sh
# build and prepare the docs for release mv-local:
release: make mv-check-env
make check-env
make clean make clean
make autodoc-index make mv-autodoc-index
make multiversion-build make multiversion-build
make deploy
make clean # build and prepare the docs for release
mv-release:
make mv-local
# make mv-deploy
@echo "" @echo ""
@echo "Deployment complete." @echo "Deployment complete."

View file

@ -1,6 +1,27 @@
# evennia-docs # evennia-docs
Documentation for the Evennia MUD creation system. Documentation for the Evennia MUD creation system.
This is very much WIP. We are still experimenting with solutions. Don't use or contribute yet. The live documentation is available at `https://evennia.github.io/evennia/`.
The live documentation will be available at `https://evennia.github.io/evennia-docs`. # building the docs
## Prerequisits
- Clone the evennia repository.
- Follow the normal Evennia Getting-Started instructions. Use a virtualenv and create
a new game folder called `gamedir` at the same level as your `evennia` repo and run migrations in it.
```
(top)
|
----- evennia/
|
----- gamedir/
```
- Make sure you are in your virtualenv. Go to `evennia/docs/` and install the `requirements.txt` or run `make install` to do the same.
## Building the docs.
With your build environment set up as above, stand in the `evennia/docs` directory and run `make local`. This builds the documentation.

View file

@ -1,11 +1,7 @@
# check environment # check environment
# common checks
# if [ -n "$(git status --untracked-files=no --porcelain)" ]; then
# echo "There are uncommitted changes. Make sure to commit everything in your current branch first."
# exit 1
# fi
if [ ! -d "$EVDIR" ]; then if [ ! -d "$EVDIR" ]; then
@ -22,3 +18,17 @@ if [ ! -d "$EVGAMEDIR" ]; then
else else
echo "Evennia game dir correctly set to $EVGAMEDIR."; echo "Evennia game dir correctly set to $EVGAMEDIR.";
fi fi
if [ $# -ne 0 ]
# a multi-version build
then
if [ -n "$(git status --untracked-files=no --porcelain)" ]; then
echo "There are uncommitted changes. Make sure to commit everything in your current branch before doing a multiversion build."
exit 1
fi
fi