Update docs

This commit is contained in:
Adrian Vollmer 2024-04-30 14:44:39 +02:00
parent a3e8d39a9e
commit fa7e438b3d
10 changed files with 1659 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
.eggs
build
dist
tests
_download
_version.py

123
Makefile Normal file
View File

@ -0,0 +1,123 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
DOWNLOAD ?= $(ROOT_DIR)/_download
OUTPUT ?= $(ROOT_DIR)/docs/output
REF ?= main
define clone_repo =
if [ -d $(DOWNLOAD)/$(2) ] ; then \
git -C $(DOWNLOAD)/$(2) pull ; \
else \
git clone --depth 1 https://github.com/$(1)/$(2) $(DOWNLOAD)/$(2) ; \
fi
endef
define create_venv =
if [ ! -d $(DOWNLOAD)/$(1)/venv ] ; then \
python3 -m venv $(DOWNLOAD)/$(1)/venv ; \
fi
endef
# Arguments:
# 1: github account
# 2: github repo
define prepare =
$(call clone_repo,$(1),$(2))
$(call create_venv,$(2))
. $(DOWNLOAD)/$(2)/venv/bin/activate ; \
pip install git+file:////$(ROOT_DIR)@$(REF)
endef
help:
@echo help
sphinx: $(OUTPUT)/sphinx.html
$(OUTPUT)/sphinx.html: Makefile
$(call prepare,sphinx-doc,sphinx)
NAME=sphinx ; \
DOCS=doc ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate ; \
pip install $(DOWNLOAD)/$$NAME[docs] ; \
make -C $(DOWNLOAD)/$$NAME/$$DOCS zundler ; \
cp $(DOWNLOAD)/$$NAME/$$DOCS/_build/zundler/index.html $(OUTPUT)/$$NAME.html
cpython: $(OUTPUT)/cpython.html
$(OUTPUT)/cpython.html: Makefile
$(call prepare,python,cpython)
NAME=cpython ; \
DOCS=Doc ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate ; \
pip install -r $(DOWNLOAD)/$$NAME/$$DOCS/requirements.txt ; \
make -C $(DOWNLOAD)/$$NAME/$$DOCS BUILDER=zundler SPHINXOPTS='-D zundler_root_doc=index' build ; \
cp $(DOWNLOAD)/$$NAME/$$DOCS/build/zundler/index.html $(OUTPUT)/$$NAME.html
myst-parser: $(OUTPUT)/myst-parser.html
$(OUTPUT)/myst-parser.html: Makefile
$(call prepare,executablebooks,myst-parser)
NAME=myst-parser ; \
DOCS=docs ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate ; \
pip install $(DOWNLOAD)/$$NAME[linkify,rtd] ; \
make -C $(DOWNLOAD)/$$NAME/$$DOCS zundler ; \
cp $(DOWNLOAD)/$$NAME/$$DOCS/_build/zundler/index.html $(OUTPUT)/$$NAME.html
flask: $(OUTPUT)/flask.html
$(OUTPUT)/flask.html: Makefile
$(call prepare,pallets,flask)
NAME=flask ; \
DOCS=docs ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate && \
pip install -r $(DOWNLOAD)/$$NAME/requirements/docs.txt && \
pip install -e $(DOWNLOAD)/$$NAME && \
make -C $(DOWNLOAD)/$$NAME/$$DOCS zundler SPHINXOPTS='-D zundler_append_post="window.addEventListener(\"load\", function(){window.document.querySelector(\"#searchbox\").style.display=\"\"});"' && \
cp $(DOWNLOAD)/$$NAME/$$DOCS/_build/zundler/index.html $(OUTPUT)/$$NAME.html
setuptools: $(OUTPUT)/setuptools.html
$(OUTPUT)/setuptools.html: Makefile
$(call prepare,pypa,setuptools)
NAME=setuptools ; \
DOCS=docs ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate && \
pip install -e $(DOWNLOAD)/$$NAME[docs] && \
cd $(DOWNLOAD)/$$NAME/$$DOCS && \
sphinx-build -b zundler . _build/zundler && \
cp _build/zundler/index.html $(OUTPUT)/$$NAME.html
readthedocs: $(OUTPUT)/readthedocs.html
$(OUTPUT)/readthedocs.html: Makefile
$(call prepare,readthedocs,readthedocs.org)
NAME=readthedocs.org ; \
DOCS=docs ; \
. $(DOWNLOAD)/$$NAME/venv/bin/activate && \
pip install -r $(DOWNLOAD)/$$NAME/requirements/docs.txt && \
cd $(DOWNLOAD)/$$NAME/$$DOCS && \
sphinx-build -b zundler . _build/zundler && \
cp _build/zundler/index.html $(OUTPUT)/$$NAME.html
clean:
@rm -rf $(DOWNLOAD)
all: sphinx cpython myst-parser flask pygments setuptools
.PHONY: all clean sphinx cpython myst-parser flask pygments setuptools

14
docs/index.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html><html><head></head><body>
Self-contained HTML files generated with <a href='https://github.com/AdrianVollmer/Zundler'>Zundler</a>:
<ul>
<li> <a href='output/cpython.html'>CPython</a>
<li> <a href='output/flask.html'>Flask</a>
<li> <a href='output/myst-parser.html'>MyST Parser</a>
<li> <a href='output/sphinx.html'>Sphinx</a>
<li> <a href='output/setuptools.html'>Setuptools</a>
<li> <a href='output/readthedocs.org.html'>Read the Docs</a>
</ul>
</body></html>

253
docs/output/cpython.html Normal file

File diff suppressed because one or more lines are too long

253
docs/output/flask.html Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

253
docs/output/setuptools.html Normal file

File diff suppressed because one or more lines are too long

253
docs/output/sphinx.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
<!DOCTYPE html><html><head></head><body>Hello, World</body></html>