From 8406815c7c298a56d7543cd2738ae9a2986b5007 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Sun, 3 Dec 2023 14:30:46 +0100 Subject: [PATCH] Add documentation generation --- .gitlab-ci.yml | 25 ++++++++++++++++++++++++- docs/.gitignore | 1 + docs/Makefile | 20 ++++++++++++++++++++ docs/conf.py | 27 +++++++++++++++++++++++++++ docs/index.rst | 15 +++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 docs/.gitignore create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37be9cd..302b85d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,4 +6,27 @@ build: script: - meson build --buildtype release --werror - ninja -C build - - cd build && meson test --no-rebuild \ No newline at end of file + - cd build && meson test --no-rebuild + +docs: + stage: test + image: alpine:edge + before_script: + - apk add --no-cache python3 py3-sphinx make + script: + - cd docs + - make html + +pages: + stage: deploy + image: alpine:edge + before_script: + - apk add --no-cache python3 py3-sphinx make + script: + - cd docs + - make html + - mv _build/html ../public + artifacts: + paths: + - public + environment: production diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..5cff9a2 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +/_build \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /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/conf.py b/docs/conf.py new file mode 100644 index 0000000..a1cf13b --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,27 @@ +# 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 = 'libmegapixels' +copyright = '2023, Martijn Braam' +author = 'Martijn Braam' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..676026a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,15 @@ +.. libmegapixels documentation master file, created by + sphinx-quickstart on Sun Dec 3 14:27:28 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +libmegapixels's documentation! +============================== + +The libmegapixels library is an abstraction library between the V4L2 system in +linux and the Megapixels GTK application. It helps with abstracting away the +media graph interface in Linux for ARM platforms with cameras. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: \ No newline at end of file