From 78b88f6c47a88138d179b2c80e46af95ebdec531 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Wed, 14 Jul 2021 11:54:16 +0200
Subject: [PATCH] WIP: generate docs

---
 .docker/Dockerfile   | 29 +++++++++++++++++------------
 .gitlab-ci.yml       | 11 +++++++----
 dev-requirements.txt |  2 ++
 doc/conf.py          | 13 -------------
 doc/requirements.txt | 24 ++++++++++++++++++++++++
 5 files changed, 50 insertions(+), 29 deletions(-)
 create mode 100644 dev-requirements.txt
 create mode 100644 doc/requirements.txt

diff --git a/.docker/Dockerfile b/.docker/Dockerfile
index dd76d60..f0f8b20 100644
--- a/.docker/Dockerfile
+++ b/.docker/Dockerfile
@@ -1,15 +1,20 @@
-FROM debian:buster
-RUN apt-get update \
-    && \
-    apt-get install -y \
-        make \
-        octave \
-        python3-pip \
-        python3-sphinx \
-        unzip \
-        wget
-
-RUN pip3 install breathe miss_hit sphinx-rtd-theme recommonmark 
+FROM debian:buster-backports
+
+RUN apt-get update
+RUN apt-get install -y make
+RUN apt-get install -y octave/buster-backports
+RUN apt-get install -y liboctave-dev
+RUN apt-get install -y python3-pip
+RUN apt-get install -y unzip
+RUN apt-get install -y wget
+
+# install generate-doc package for octave
 RUN wget --output-document generate_doc_unreleased.zip \
     https://github.com/gnu-octave/generate_doc/archive/refs/heads/main.zip
 RUN octave --eval "pkg install generate_doc_unreleased.zip"
+
+COPY doc/requirements.txt doc-requirements.txt
+RUN pip3 install -r doc-requirements.txt
+
+COPY dev-requirements.txt dev-requirements.txt
+RUN pip3 install -r dev-requirements.txt
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6567c2e..632a8b9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -37,9 +37,6 @@ build-testenv:
   tags: [ cached-dind ]
   stage: setup
   image: docker:20.10
-  only:
-    - schedules
-    - f-package-docs
   script:
     - cd .docker
     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
@@ -57,7 +54,7 @@ code_style:
   tags: [ docker ]
   stage: test
   script:
-    - mh_style --octave src pkg doc
+    - mh_style --octave ./
   allow_failure: true
 
 # Unit tests
@@ -67,6 +64,12 @@ test:
   script:
     - make test
 
+linting:
+  tags: [ docker ]
+  stage: test
+  script:
+    - mh_lint --octave ./
+
 
 # Build the sphinx documentation and make it ready for deployment by Gitlab Pages
 # Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
diff --git a/dev-requirements.txt b/dev-requirements.txt
new file mode 100644
index 0000000..f12580b
--- /dev/null
+++ b/dev-requirements.txt
@@ -0,0 +1,2 @@
+miss-hit==0.9.23
+miss-hit-core==0.9.23
diff --git a/doc/conf.py b/doc/conf.py
index fe13ebe..b7c2ef8 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -44,9 +44,6 @@ release = '0.1.0'
 # ones.
 extensions = [
     'sphinx.ext.autosectionlabel',
-    'sphinx.ext.intersphinx',
-    'sphinx.ext.napoleon',     # For Google style docstrings
-    "recommonmark",            # For markdown files.
     "sphinx_rtd_theme",
 ]
 
@@ -116,13 +113,3 @@ htmlhelp_basename = 'caosdb-octavelibdoc'
 
 
 # -- Extension configuration -------------------------------------------------
-
-# -- Options for intersphinx -------------------------------------------------
-
-# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_mapping
-intersphinx_mapping = {
-    "python": ("https://docs.python.org/", None),
-    "caosdb-mysqlbackend": ("https://caosdb.gitlab.io/caosdb-mysqlbackend/",
-                            None),
-    "caosdb-server": ("https://caosdb.gitlab.io/caosdb-server/", None),
-}
diff --git a/doc/requirements.txt b/doc/requirements.txt
new file mode 100644
index 0000000..edb4db0
--- /dev/null
+++ b/doc/requirements.txt
@@ -0,0 +1,24 @@
+alabaster==0.7.12
+Babel==2.9.1
+certifi==2021.5.30
+charset-normalizer==2.0.1
+docutils==0.16
+idna==3.2
+imagesize==1.2.0
+Jinja2==3.0.1
+MarkupSafe==2.0.1
+packaging==21.0
+Pygments==2.9.0
+pyparsing==2.4.7
+pytz==2021.1
+requests==2.26.0
+snowballstemmer==2.1.0
+Sphinx==4.1.0
+sphinx-rtd-theme==0.5.2
+sphinxcontrib-applehelp==1.0.2
+sphinxcontrib-devhelp==1.0.2
+sphinxcontrib-htmlhelp==2.0.0
+sphinxcontrib-jsmath==1.0.1
+sphinxcontrib-qthelp==1.0.3
+sphinxcontrib-serializinghtml==1.1.5
+urllib3==1.26.6
-- 
GitLab