HRTCloudDemo / HRTCloudDemo.github.io

Website for the IBM Cloud Workshop at Hochschule Reutlingen
http://hrtclouddemo.github.io
2 stars 2 forks source link

Spell Checker #2

Closed suhlig closed 6 years ago

suhlig commented 6 years ago

e.g. curl -L http://hrtclouddemo.github.io/ | pandoc --from html --to plain | aspell --list

AC: When a commit is pushed that contains spelling errors, the build will break and the code will not be published.

suhlig commented 6 years ago

Instead of using aspell, we could use hunspell which uses OpenOffice dictionaries. There is a nice tutorial for running it on the command line. On macOS at least, hunspell comes without dictionaries. Download en_us.oxt from https://sourceforge.net/projects/aoo-extensions/files/1470/1/ and unzip it with unzip en_us.oxt -d dict-en_US. The results are assumed to be in ~/Downloads/dict-en_US.

Instead of testing the already pushed content, we should run the check before it is published. This could be done in a build pipeline that runs the aforementioned steps. The actual spell check would just test whether a call like this is empty:

pandoc _labs/002-static-webpage.markdown -t plain | DICPATH=.:~/Downloads/dict-en_US hunspell -d en_US -p local.dic -l

While we are creating a pipeline anyway, we might as well just run jekyll build and push the app as static files to Bluemix (which is what we explain in this very workshop).

suhlig commented 6 years ago

Fixed with 8b64ffc0d1c904027d67c255c0e231937ece25e8 (sans the pipeline aspect)