diff --git a/.clang-format b/.clang-format deleted file mode 100644 index e3845288..00000000 --- a/.clang-format +++ /dev/null @@ -1 +0,0 @@ -DisableFormat: true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..682b4bbb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +docs/Makefile generated +docs/make.bat generated +*.svg generated +*.png binary diff --git a/.gitignore b/.gitignore index dbb49ea4..a2bd0196 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ __pycache__/ # LSP .vscode/ compile_flags.txt + +# Sphinx +docs/_build/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# 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 + +# 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) diff --git a/docs/_static/favicon.svg b/docs/_static/favicon.svg new file mode 100644 index 00000000..cce6a9bd --- /dev/null +++ b/docs/_static/favicon.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/logo_black.svg b/docs/_static/logo_black.svg new file mode 100644 index 00000000..2499c3fc --- /dev/null +++ b/docs/_static/logo_black.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/logo_white.svg b/docs/_static/logo_white.svg new file mode 100644 index 00000000..f7bd0e4d --- /dev/null +++ b/docs/_static/logo_white.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..1ebdf4fa --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,32 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "view.py" +copyright = "2026, Peter Bierma" +author = "Peter Bierma" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx.ext.intersphinx"] + +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "shibuya" +html_theme_options = { + "accent_color": "blue", + # "light_logo": "_static/logo_black.svg", + # "dark_logo": "_static/logo_white.svg", +} +html_static_path = ["_static"] +# html_favicon = "_static/favicon.svg" diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..683abe85 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,8 @@ +view.py documentation +===================== + +Nothing here yet... + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..32bb2452 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..2c65f8fd --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] +command = "sphinx-build -M html ./docs ./site" +publish = "site/html" diff --git a/pyproject.toml b/pyproject.toml index d18f7e5e..bf1c30f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ view = "view.__main__:main" view-py = "view.__main__:main" [tool.ruff] -exclude = ["tests/"] +exclude = ["tests/", "docs/"] line-length = 79 indent-width = 4 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..781e4d48 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# Requirements for Netlify +sphinx>=7.0 +shibuya~=2025.8 diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 00000000..c8cfe395 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +3.10