Prechádzať zdrojové kódy

Add documentation generation

Martijn Braam 5 mesiacov pred
rodič
commit
8406815c7c
5 zmenil súbory, kde vykonal 87 pridanie a 1 odobranie
  1. 24 1
      .gitlab-ci.yml
  2. 1 0
      docs/.gitignore
  3. 20 0
      docs/Makefile
  4. 27 0
      docs/conf.py
  5. 15 0
      docs/index.rst

+ 24 - 1
.gitlab-ci.yml

@@ -6,4 +6,27 @@ build:
   script:
     - meson build --buildtype release --werror
     - ninja -C build
-    - cd build && meson test --no-rebuild
+    - 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

+ 1 - 0
docs/.gitignore

@@ -0,0 +1 @@
+/_build

+ 20 - 0
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)

+ 27 - 0
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']

+ 15 - 0
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: