mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-01 03:43:46 +08:00
Sphinx docs generation (#22697)
* add sphinx * switch theme * Experiment: sphinx docs generation updated (#22708) * moved build to root gitignore, added .gitkeep * Improved makefile doc build process - Removed auto-generated docs from source control - Moved apidoc.sh into Makefile - Removed make.bat (can add back if Windows support desired) - Added sphinx viewcode and markdown extensions - Added feature to source /docs in build, so any .rst file in /docs will override the respective file during the build process - Added feature to copy all markdown/rst files from source into /build/ during build process so they can be easily referenced while writing docs (see examples in index.md) - Wrote basic starter index.md file TODO: Add new dependencies to Pipfile [dev-packages] * Revert accidental modification to Pipfile * fix command substitution * exclude xx * improve docs * dont include all docs in release build * Add dockerfile * update title * include normal readme * build container in CI * use buildkit * add login Co-authored-by: Chad Bailey <chadbailey904@gmail.com> old-commit-hash: b816b5b6442c21e63a09108c70986eeedb0372b2
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
OPENPILOT_ROOT = `git rev-parse --show-toplevel`
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
DOCSDIR = "$(OPENPILOT_ROOT)/docs"
|
||||
SOURCEDIR = "$(OPENPILOT_ROOT)/build/docs"
|
||||
DOCSBUILDDIR = "$(OPENPILOT_ROOT)/build/docs"
|
||||
BUILDDIR = "$(OPENPILOT_ROOT)/build"
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(DOCSBUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
clean:
|
||||
@echo "Cleaning build folder..."
|
||||
rm -rf "$(BUILDDIR)"
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@echo "Cleaning build folder..."
|
||||
rm -rf "$(BUILDDIR)"
|
||||
mkdir -p "$(DOCSBUILDDIR)"
|
||||
|
||||
@echo "Copying docs & config to build folder..."
|
||||
cp -a "$(DOCSDIR)" "$(BUILDDIR)"
|
||||
cd "$(OPENPILOT_ROOT)" && \
|
||||
find . -type f \( -name "*.md" -o -name "*.rst" \) \
|
||||
-not -path "*/.*" \
|
||||
-not -path "./build/*" \
|
||||
-not -path "./docs/*" \
|
||||
-not -path "./xx/*" \
|
||||
-exec cp --parents "{}" ./build/docs/ \;
|
||||
|
||||
@echo "Building rst files..."
|
||||
sphinx-apidoc -o "$(DOCSBUILDDIR)" ../ \
|
||||
../xx ../laika_repo ../rednose_repo ../pyextra ../notebooks ../panda_jungle \
|
||||
../third_party \
|
||||
../panda/examples \
|
||||
../scripts \
|
||||
../selfdrive/modeld \
|
||||
../selfdrive/debug \
|
||||
$(shell find .. -type d -name "*test*")
|
||||
|
||||
@echo "Building html files..."
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(DOCSBUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
Reference in New Issue
Block a user