mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 21:48:41 +00:00
Take snapshots of formulas rendered by LaTeX and compute visual diffs
The same test cases we use for our screenshots from Firefox are now also being rendered by pdflatex, so the resulting images can be used as reference for how things are supposed to look (if we concentrate on compatibility with LaTeX). To make comparisons even easier, the differences between LaTeX and Firefox snapshots are rendered in a visual way, using different colors. Discussed in pull request #268.
This commit is contained in:
17
dockers/texcmp/texcmp.sh
Executable file
17
dockers/texcmp/texcmp.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
imgname=katex/texcmp
|
||||
tag=1.1
|
||||
imgid=$(docker images | awk "/${imgname//\//\\/} *${tag//./\\.}/{print \$3}")
|
||||
cd "$(dirname "$0")" || exit $?
|
||||
npm install || exit $?
|
||||
if [[ -z ${imgid} ]]; then
|
||||
docker build -t "${imgname}:${tag}" . || exit $?
|
||||
fi
|
||||
base=$(cd ../..; pwd)
|
||||
docker run --rm \
|
||||
-v "${base}":/KaTeX \
|
||||
-w /KaTeX/dockers/texcmp \
|
||||
"${imgname}:${tag}" \
|
||||
nodejs texcmp.js "$@"
|
Reference in New Issue
Block a user