From 2bb783b5d49cdd095cb0a9e5b533a61cebe8b291 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Fri, 22 Sep 2023 11:09:55 +0200
Subject: [PATCH] ci: Add HTML documentation.

---
 .gitlab-ci.yml     | 11 +++++++++++
 doc/dev/build.sh   | 11 +++++++++--
 doc/users/build.sh | 11 +++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5f12c3e7..7f2aecdf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -109,9 +109,18 @@ build-developers-doc:
   script:
     - cd ./doc/dev/
     - ./build.sh
+    # Create html documentation
+    - cd ../../src
+    - pdoc --html .
+    # Create archive
+    - tar cf html.tar ./html
+    - cd ../doc/dev
+    - mv ../../src/html.tar ./
   artifacts:
     paths:
       - doc/dev/documentation.pdf
+      - doc/dev/documentation.html
+      - doc/dev/html.tar
 
 build-linux:
   stage: build
@@ -167,8 +176,10 @@ build-linux:
     - cp ../tests_cases/Saar/Saar.pamhyr pamhyr/tests_cases/Saar/
     # Copy documentations
     - mkdir -p pamhyr/doc/
+    - mkdir -p pamhyr/doc/html/
     - cp ../doc/users/documentation.pdf pamhyr/doc/Pamhyr2-users.pdf
     - cp ../doc/dev/documentation.pdf pamhyr/doc/Pamhyr2-dev.pdf
+    - cp ../doc/dev/documentation.html pamhyr/doc/html/dev.html
     # Create running script
     - echo "#!/bin/sh" > pamhyr/Pamhyr2
     - echo "./pamhyr/pamhyr $@" >> pamhyr/Pamhyr2
diff --git a/doc/dev/build.sh b/doc/dev/build.sh
index 476dd5ad..bf1a6790 100755
--- a/doc/dev/build.sh
+++ b/doc/dev/build.sh
@@ -1,10 +1,17 @@
 #! /bin/sh
 
-# Build the PDF
-
+echo " PDF  documentation.org"
 emacs -Q -q -nw --batch                                 \
       --eval "(require 'org)"                           \
       --eval "(require 'ox-latex)"                      \
       --eval "(load-file \"../tools/setup.el\")"        \
       --file ./documentation.org                        \
       -f org-latex-export-to-pdf
+
+echo " HTML documentation.org"
+emacs -Q -q -nw --batch                                 \
+      --eval "(require 'org)"                           \
+      --eval "(require 'ox-latex)"                      \
+      --eval "(load-file \"../tools/setup.el\")"        \
+      --file ./documentation.org                        \
+      -f org-html-export-to-html
diff --git a/doc/users/build.sh b/doc/users/build.sh
index 476dd5ad..bf1a6790 100755
--- a/doc/users/build.sh
+++ b/doc/users/build.sh
@@ -1,10 +1,17 @@
 #! /bin/sh
 
-# Build the PDF
-
+echo " PDF  documentation.org"
 emacs -Q -q -nw --batch                                 \
       --eval "(require 'org)"                           \
       --eval "(require 'ox-latex)"                      \
       --eval "(load-file \"../tools/setup.el\")"        \
       --file ./documentation.org                        \
       -f org-latex-export-to-pdf
+
+echo " HTML documentation.org"
+emacs -Q -q -nw --batch                                 \
+      --eval "(require 'org)"                           \
+      --eval "(require 'ox-latex)"                      \
+      --eval "(load-file \"../tools/setup.el\")"        \
+      --file ./documentation.org                        \
+      -f org-html-export-to-html
-- 
GitLab