Skip to content

Commit 9523bfc

Browse files
Auto-generate automatic documentation at document build-time
There's little reason to include the files that would get built and/or rebuilt by Sphinx. Avoids bloated diffs.
1 parent 80bdbe6 commit 9523bfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+66
-4619
lines changed

.github/workflows/sphinx.yml

-85
This file was deleted.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ __pycache__/
99
*.egg-info/
1010
build/
1111
dist/
12+
# Contains files which are automatically generated by the documentation build process.
13+
docs/source/_autogenerated

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ container:
1111
clean:
1212
set -o pipefail
1313

14-
@echo '[.] Removing built packages ...'
14+
@echo '[.] Removing built packages and documentation ...'
1515
rm -rf dist/
16+
make --directory=./docs/ clean
1617

1718
@echo '[.] Cleaning __pycache__ directories ...'
1819
find . -type d -name '__pycache__' | xargs rm -rf

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ updates.__ 💥
2323
<!-- README.md-Table-of-Contents_Before -->
2424
# Table of Contents
2525
- [Motivation & Goals](#motivation--goals)
26+
- [Installation](#installation)
2627
- [Open-Source License](#open-source-license)
2728
- [Contributing](#contributing)
2829
- [Concepts](#concepts)
@@ -32,7 +33,6 @@ updates.__ 💥
3233
- [Local State](#local-state)
3334
- [Remote State](#remote-state)
3435
- [Usage](#usage)
35-
- [Installation](#installation)
3636
- [The `Boardwalkfile.py`](#the-boardwalkfilepy)
3737
- [Command-line Interface](#environment-variables)
3838
- [`boardwalkd` Server](#boardwalkd-server)
@@ -223,7 +223,6 @@ Boardwalk.
223223

224224
# Usage
225225

226-
(the-boardwalkfilepy)=
227226
## The `Boardwalkfile.py`
228227

229228
Boardwalk is both a python library and command-line tool. The `boardwalk`

docs/Makefile

+16-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,28 @@ SOURCEDIR = source
99
BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
12+
.PHONY: help Makefile
1213
help:
1314
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14-
.PHONY: help Makefile
15+
16+
# Define some build targets manually, since we also have the auto-generated documentation to handle
17+
.PHONY: clean
18+
clean:
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
-rm -r source/_autogenerated
21+
22+
.PHONY: generate_cli_help_page_sources
23+
generate_cli_help_page_sources:
24+
./build_cli_help_pages.sh
25+
26+
.PHONY: html
27+
html: generate_cli_help_page_sources
28+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1529

1630
# Catch-all target: route all unknown targets to Sphinx using the new
1731
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1832
%: Makefile
1933
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2034

21-
livehtml:
35+
livehtml: generate_cli_help_page_sources
2236
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/build_cli_help_pages.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ GET_PAGE_NAME() {
3030
echo '`'"$1"'`'
3131
}
3232

33+
AUTO_GEN_DIR=source/_autogenerated/cli_helpdocs
34+
mkdir -p "$AUTO_GEN_DIR"
35+
mkdir -p "$AUTO_GEN_DIR/boardwalk"
36+
mkdir -p "$AUTO_GEN_DIR/boardwalkd"
37+
3338
for cmd in "${commands[@]}"; do
3439
# Define regular expression patterns for 'boardwalk' and 'boardwalkd', so we
3540
# can sort them into the correct subdirectories. Note that we need to use
@@ -47,8 +52,9 @@ for cmd in "${commands[@]}"; do
4752
echo "[!] Skipping generation for $cmd; is this a boardwalk or boardwalkd command?"
4853
continue
4954
fi
50-
FILENAME=./source/cli_helpdocs/$SUBDIR/$(echo "$cmd" | tr ' ' _).md
51-
echo "[+] Generating doc page for $FILENAME"
55+
FILENAME=$AUTO_GEN_DIR/$SUBDIR/$(echo "$cmd" | tr ' ' _).md
56+
echo "[+] Generating doc page for $cmd"
57+
touch "$FILENAME"
5258
{
5359
echo "# $(GET_PAGE_NAME "$cmd")"
5460
echo ""

docs/source/apidocs/boardwalk/boardwalk.__main__.md

-8
This file was deleted.

docs/source/apidocs/boardwalk/boardwalk.ansible.md

-144
This file was deleted.

docs/source/apidocs/boardwalk/boardwalk.app_exceptions.md

-36
This file was deleted.

0 commit comments

Comments
 (0)