CI: take screenshots

Change-Id: Ie9aac54f4b3aa7e0b7a14d804b157ad18e4879c9
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 23360bb..4158920 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,27 +17,36 @@
   artifacts:
     paths:
       - "target/*"
+      - "target/ids_files/*"
 
   before_script:
     - source `find .. -name section_helper.sh`
 
     - start_section install_linux_packages "Installing missing Linux packages"
     - apt-get update
-    - apt-get install -y libu2f-udev fonts-liberation build-essential libglpk40 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libxt6 libpq-dev imagemagick curl
+    - apt-get install -y libvulkan1 libu2f-udev fonts-liberation build-essential libglpk40 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libxt6 libpq-dev imagemagick
+    - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+    - dpkg -i google-chrome-stable_current_amd64.deb || apt-get install -y -f
     - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
-
     - end_section install_linux_packages
 
+
+    - start_section install_fonts "Installing Libertinus and Fira fonts"
+    - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
+    - fc-cache
+    - end_section install_fonts
+
     - start_section install_r_packages "Installing missing R packages"
     - R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite', 'qrcode', 'rsvg', 'highcharter'))"
     - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
     - R -e 'devtools::install(".")'
-    - curl -O --output-dir /tmp/ https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R
-    - cat /tmp/common.R
-    - R -e 'source("/tmp/common.R")'
     - end_section install_r_packages
 
   script:
     - start_section render "Running scripts"
     - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('examples/ids.Rmd', output_format='revealjs::revealjs_presentation', output_dir='target')"
+    - ./ci/screenshot target/ids.html target/title.png
+    - ./ci/screenshot file://`pwd`/target/ids.html#/light-verb-constructions target/lvc.png
+    - ./ci/screenshot file://`pwd`/target/ids.html#/registered-users target/users.png
+    - ./ci/screenshot file://`pwd`/target/ids.html#/references target/references.png
     - end_section render
diff --git a/README.Rmd b/README.Rmd
index 82808cf..fa3ef8d 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -1,5 +1,5 @@
 ---
-title: "R Markdown Format for reveal.js Presentations – extended by ids theme"
+title: "R Markdown Format for reveal.js Presentations – Extended by an IDS Mannheim CD Theme"
 output: github_document
 ---
 
@@ -9,6 +9,15 @@
 [![reveal.js](https://img.shields.io/badge/reveal.js-`r revealjs:::revealjs_version()`-yellow)](https://github.com/rstudio/revealjs/tree/main/inst/reveal.js-`r revealjs:::revealjs_version()`)
 <!-- badges: end -->
 
+## Screenshots
+
+![title](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/title.png?job=build-job)
+
+![users](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/users.png?job=build-job)
+![lvc](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/lvc.png?job=build-job)
+
+![references](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/references.png?job=build-job)
+
 ## Overview
 
 This repository provides an [R Markdown](http://rmarkdown.rstudio.com) custom format for [reveal.js](https://revealjs.com/) HTML presentations. The packages includes _reveal.js_ library in version `r revealjs:::revealjs_version()`
diff --git a/README.md b/README.md
index 71683a4..f01d0e6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
-R Markdown Format for reveal.js Presentations – extended by ids theme
+R Markdown Format for reveal.js Presentations – Extended by an IDS
+Mannheim CD Theme
 ================
 
 <!-- badges: start -->
@@ -9,6 +10,15 @@
 [![reveal.js](https://img.shields.io/badge/reveal.js-4.6.1-yellow)](https://github.com/rstudio/revealjs/tree/main/inst/reveal.js-4.6.1)
 <!-- badges: end -->
 
+## Screenshots
+
+![title](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/title.png?job=build-job)
+
+![users](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/users.png?job=build-job)
+![lvc](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/lvc.png?job=build-job)
+
+![references](https://gitlab.ids-mannheim.de/ids/revealjs/-/jobs/artifacts/main/raw/target/references.png?job=build-job)
+
 ## Overview
 
 This repository provides an [R Markdown](http://rmarkdown.rstudio.com)
diff --git a/ci/screenshot b/ci/screenshot
new file mode 100755
index 0000000..7b2acb5
--- /dev/null
+++ b/ci/screenshot
@@ -0,0 +1,3 @@
+#!/bin/sh -eu
+in=$1 out=$2 page0=${3:-} page1=${4:-$page0}
+google-chrome --disable-web-security --user-data-dir="./" --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --window-size=1024,576 --timeout=6000 --screenshot="$out" "$in"