diff --git a/.gitignore b/.gitignore index 66dbf51b..017e2457 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.egg-info *.pyc + +# Sphinx +docs/build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa9f94f1..246f49ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,7 @@ repos: rev: v1.5.1 hooks: - id: forbid-tabs + exclude: docs/make.bat|docs/Makefile - repo: https://github.com/pappasam/toml-sort rev: v0.23.1 hooks: diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /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 = source +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/make.bat b/docs/make.bat new file mode 100644 index 00000000..dc1312ab --- /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=source +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/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..b5a754c8 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,7 @@ +linkify-it-py +myst-parser +nbsphinx +pydata-sphinx-theme +setuptools-scm +sphinx +sphinx-autodoc-typehints diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..72087ef7 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,24 @@ +# Configuration file for the Sphinx documentation builder. # noQA: D100 +# +# 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 = "Python Template" +copyright_var = "2023, UCL ARC" +author = "UCL ARC" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + + +templates_path = ["_templates"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "pydata_sphinx_theme" +html_static_path = ["_static"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..8f45658d --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,29 @@ +.. Python Template documentation master file, created by + sphinx-quickstart on Tue Jul 25 11:26:38 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Lumache's documentation! +=================================== + +**Lumache** (/lu'make/) is a Python library for cooks and food lovers that +creates recipes mixing random ingredients. It pulls data from the `Open Food +Facts database `_ and offers a *simple* and +*intuitive* API. + +.. note:: + + This project is under active development. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search`