Basic perceptual diffing support for KaTeX

Summary:
This commit adds an HTML file for creating perceptual diffs (pdiff.html),
a reference screenshot of that HTML file (pdiff.png), and a quick script
for comparing that screenshot to a newly generated one (pdiff.js).

Also added a basic README.

Test Plan: make pdiff

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6415
This commit is contained in:
Alex Lopatin
2014-01-29 16:29:21 -08:00
parent 50c1242147
commit a3663ce17c
6 changed files with 124 additions and 2 deletions

View File

@@ -1,8 +1,10 @@
.PHONY: build setup copy serve clean
build: setup build/katex.js build/katex.less.css
build: setup build/katex.js build/katex.less.css pdiff
setup:
npm install
brew install webkit2png
brew install graphicsmagick
compress: build/katex.min.js
@printf "Minified, gzipped size: "
@@ -20,5 +22,12 @@ build/katex.less.css: static/katex.less
serve:
node server.js
pdiff:
@printf "Creating new pdiff image...\n"
@webkit2png http://localhost:7936/test/pdiff.html -F --transparent -D build -o pdiff >/dev/null 2>&1
@mv build/pdiff-full.png build/pdiff.png
@printf "Comparing to reference pdiff image...\n"
@node test/pdiff.js
clean:
rm -rf build/*