From feb506f584a88539f359b0dc82d503a1d8e882f6 Mon Sep 17 00:00:00 2001
From: Jan Frenzel <jan.frenzel@tu-dresden.de>
Date: Thu, 5 Aug 2021 14:46:11 +0200
Subject: [PATCH] Added a way to spell-check files.

---
 Dockerfile                            | 2 +-
 doc.zih.tu-dresden.de/README.md       | 8 ++++++++
 doc.zih.tu-dresden.de/spellcheck.sh   | 5 +++++
 doc.zih.tu-dresden.de/wordlist.aspell | 1 +
 4 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100755 doc.zih.tu-dresden.de/spellcheck.sh
 create mode 100644 doc.zih.tu-dresden.de/wordlist.aspell

diff --git a/Dockerfile b/Dockerfile
index d8d77ca7c..67ffffaa2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@ RUN pip install -r /src/doc.zih.tu-dresden.de/requirements.txt
 # Linter #
 ##########
 
-RUN apt update && apt install -y nodejs npm
+RUN apt update && apt install -y nodejs npm aspell
 
 RUN npm install -g markdownlint-cli markdown-link-check
 
diff --git a/doc.zih.tu-dresden.de/README.md b/doc.zih.tu-dresden.de/README.md
index f18af80c4..b538ce940 100644
--- a/doc.zih.tu-dresden.de/README.md
+++ b/doc.zih.tu-dresden.de/README.md
@@ -157,6 +157,14 @@ To check a single file, e. g. `doc.zih.tu-dresden.de/docs/software/big_data_fram
 docker run --name=hpc-compendium --rm -it -w /docs --mount src="$(pwd)"/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium markdown-link-check docs/software/big_data_frameworks.md
 ```
 
+For spell-checking all files, use:
+
+```Bash
+docker run --name=hpc-compendium --rm -it -w /docs --mount src="$(pwd)"/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium ./spellcheck.sh
+```
+
+This outputs all words of all files that are unknown to the spell checker. To let the spell checker "know" a word, append it to `doc.zih.tu-dresden.de/wordlist.aspell`.
+
 #### Build Static Documentation
 
 To build the documentation, invoke `mkdocs build`. This will create a new directory named `public`
diff --git a/doc.zih.tu-dresden.de/spellcheck.sh b/doc.zih.tu-dresden.de/spellcheck.sh
new file mode 100755
index 000000000..78847b5bc
--- /dev/null
+++ b/doc.zih.tu-dresden.de/spellcheck.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+for i in `find -name \*.md`
+do
+cat $i | aspell -p ./wordlist.aspell list
+done | sort -u
diff --git a/doc.zih.tu-dresden.de/wordlist.aspell b/doc.zih.tu-dresden.de/wordlist.aspell
new file mode 100644
index 000000000..56016a3f1
--- /dev/null
+++ b/doc.zih.tu-dresden.de/wordlist.aspell
@@ -0,0 +1 @@
+personal_ws-1.1 en 1805 
-- 
GitLab