nwb-linkml/docs/Makefile

50 lines
1.7 KiB
Makefile
Raw Normal View History

2023-09-08 02:32:17 +00:00
# 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 = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
2023-10-18 08:01:15 +00:00
serve:
# env variable that makes it so we don't build all the models while in dev mode
SPHINX_MINIMAL="True" sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) \
--watch ../nwb_linkml/src/nwb_linkml \
--watch ../nwb_schema_language/src/nwb_schema_language \
--re-ignore ".*jupyter_execute.*"
2023-10-18 08:01:15 +00:00
serve_fast:
sphinx-autobuild -a "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) --watch ../nwb_linkml/src/nwb_linkml --watch ../nwb_schema_language/src/nwb_schema_language
models:
export SPHINX_APIDOC_OPTIONS="members,show-inheritance,exclude-members ConfiguredBaseClass"
rm ./api/models/*
sphinx-apidoc -e --force \
--templatedir=./_templates \
--implicit-namespaces \
-o ./api/models/ \
../nwb_linkml/src/nwb_linkml/ \
"*[!models]*"
find ./api/models/ -type f ! -name '*models*' -delete
# fix names so they're not so dang long
find ./api/models -type f -name '*.rst' -exec gsed -i -e 's/^.*\.\(.*\) package/\1 /g' {} \;
find ./api/models -type f -name '*.rst' -exec gsed -i -e 's/^.*\.\(.*\) module/\1 /g' {} \;
2023-09-08 02:32:17 +00:00
# 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)
2023-10-18 08:01:15 +00:00