Make our own screenshotting script instead of using huxley
Summary: Create our own screenshotting script which takes screenshots. This improves over huxley for a couple reasons: - It makes the screenshots the correct size (for some reason, huxley struggles with this). - Its configuration matches more with what we want (we don't need multiple screenshots or interaction, we just want a single static shot) - It runs faster I also changed the docs to reflect this change. Test Plan: - Make sure all of the tests that were in the Huxleyfile are now in ss_data.json - Run the screenshotter docker - Make sure all of the images look reasonable and don't change (except sometimes the Lap test, which has some strange pixel-positioning differences...) Reviewers: kevinb Reviewed By: kevinb Differential Revision: https://phabricator.khanacademy.org/D16731
BIN
test/screenshotter/images/Accents-firefox.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
test/screenshotter/images/Baseline-firefox.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
test/screenshotter/images/BasicTest-firefox.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
test/screenshotter/images/BinomTest-firefox.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
test/screenshotter/images/Colors-firefox.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
test/screenshotter/images/DeepFontSizing-firefox.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
test/screenshotter/images/DelimiterSizing-firefox.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
test/screenshotter/images/DisplayMode-firefox.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
test/screenshotter/images/DisplayStyle-firefox.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
test/screenshotter/images/Exponents-firefox.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/screenshotter/images/FractionTest-firefox.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
test/screenshotter/images/Functions-firefox.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/screenshotter/images/GreekLetters-firefox.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/screenshotter/images/KaTeX-firefox.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/screenshotter/images/Lap-firefox.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
test/screenshotter/images/LeftRight-firefox.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
test/screenshotter/images/LeftRightListStyling-firefox.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
test/screenshotter/images/LeftRightStyleSizing-firefox.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
test/screenshotter/images/NestedFractions-firefox.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
test/screenshotter/images/NullDelimiterInteraction-firefox.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
test/screenshotter/images/OpLimits-firefox.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
test/screenshotter/images/Overline-firefox.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/screenshotter/images/PrimeSpacing-firefox.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
test/screenshotter/images/RlapBug-firefox.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
test/screenshotter/images/Rule-firefox.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
test/screenshotter/images/Sizing-firefox.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/screenshotter/images/SizingBaseline-firefox.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
test/screenshotter/images/Spacing-firefox.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/screenshotter/images/Sqrt-firefox.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/screenshotter/images/SupSubCharacterBox-firefox.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
test/screenshotter/images/SupSubHorizSpacing-firefox.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/screenshotter/images/SupSubOffsets-firefox.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
test/screenshotter/images/Text-firefox.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/screenshotter/images/VerticalSpacing-firefox.png
Normal file
After Width: | Height: | Size: 18 KiB |
36
test/screenshotter/ss_data.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"Accents": "http://localhost:7936/test/screenshotter/test.html?m=\\vec{A}\\vec{x}\\vec x^2\\vec{x}_2^2\\vec{A}^2\\vec{xA}^2",
|
||||
"Baseline": "http://localhost:7936/test/screenshotter/test.html?m=a+b-c\\cdot d/e",
|
||||
"BasicTest": "http://localhost:7936/test/screenshotter/test.html?m=a",
|
||||
"BinomTest": "http://localhost:7936/test/screenshotter/test.html?m=\\dbinom{a}{b}\\tbinom{a}{b}^{\\binom{a}{b}+17}",
|
||||
"Colors": "http://localhost:7936/test/screenshotter/test.html?m=\\blue{a}\\color{%230f0}{b}\\color{red}{c}",
|
||||
"DeepFontSizing": "http://localhost:7936/test/screenshotter/test.html?m=a^{\\big| x^{\\big(}}_{\\Big\\uparrow} + i^{i^{\\Huge x}_y}_{\\Huge z} + \\dfrac{\\Huge x}{y}",
|
||||
"DelimiterSizing": "http://localhost:7936/test/screenshotter/test.html?m=\\bigl\\uparrow\\Bigl\\downarrow\\biggl\\updownarrow\\Biggl\\Uparrow\\Biggr\\Downarrow\\biggr\\langle\\Bigr\\}\\bigr\\rfloor",
|
||||
"DisplayMode": "http://localhost:7936/test/screenshotter/test.html?m=\\sum_{i=0}^\\infty \\frac{1}{i}&pre=pre&post=post&display=1",
|
||||
"DisplayStyle": "http://localhost:7936/test/screenshotter/test.html?m={\\displaystyle\\sqrt{x}}{\\sqrt{x}}{\\displaystyle \\frac12}{\\frac12}{\\displaystyle x^1_2}{x^1_2}",
|
||||
"Exponents": "http://localhost:7936/test/screenshotter/test.html?m=a^{a^a_a}_{a^a_a}",
|
||||
"FractionTest": "http://localhost:7936/test/screenshotter/test.html?m=\\dfrac{a}{b}\\frac{a}{b}\\tfrac{a}{b}",
|
||||
"Functions": "http://localhost:7936/test/screenshotter/test.html?m=\\sin\\cos\\tan\\ln\\log",
|
||||
"GreekLetters": "http://localhost:7936/test/screenshotter/test.html?m=\\alpha\\beta\\gamma\\omega",
|
||||
"KaTeX": "http://localhost:7936/test/screenshotter/test.html?m=\\KaTeX",
|
||||
"Lap": "http://localhost:7936/test/screenshotter/test.html?m=ab\\llap{f}cd\\rlap{g}h",
|
||||
"LeftRight": "http://localhost:7936/test/screenshotter/test.html?m=\\left( x^2 \\right) \\left\\{ x^{x^{x^{x^x}}} \\right.",
|
||||
"LeftRightListStyling": "http://localhost:7936/test/screenshotter/test.html?m=a+\\left(x+y\\right)-x",
|
||||
"LeftRightStyleSizing": "http://localhost:7936/test/screenshotter/test.html?m=+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.}}",
|
||||
"NestedFractions": "http://localhost:7936/test/screenshotter/test.html?m=\\dfrac{\\frac{a}{b}}{\\frac{c}{d}}\\dfrac{\\dfrac{a}{b}}{\\dfrac{c}{d}}\\frac{\\frac{a}{b}}{\\frac{c}{d}}",
|
||||
"NullDelimiterInteraction": "http://localhost:7936/test/screenshotter/test.html?m=a \\bigl. + 2 \\quad \\left. + a \\right)",
|
||||
"OpLimits": "http://localhost:7936/test/screenshotter/test.html?m={\\sin_2^2 \\lim_2^2 \\int_2^2 \\sum_2^2}{\\displaystyle \\lim_2^2 \\int_2^2 \\intop_2^2 \\sum_2^2}",
|
||||
"Overline": "http://localhost:7936/test/screenshotter/test.html?m=\\overline{x}\\overline{x}\\overline{x^{x^{x^x}}} \\blue{\\overline{y}}",
|
||||
"PrimeSpacing": "http://localhost:7936/test/screenshotter/test.html?m=f'+f_2'+f^{f'}",
|
||||
"RlapBug": "http://localhost:7936/test/screenshotter/test.html?m=\\frac{\\rlap{x}}{2}",
|
||||
"Rule": "http://localhost:7936/test/screenshotter/test.html?m=\\rule{1em}{0.5em}\\rule{1ex}{2ex}\\rule{1em}{1ex}\\rule{1em}{0.431ex}",
|
||||
"SizingBaseline": "http://localhost:7936/test/screenshotter/test.html?m={\\tiny a+b}a+b{\\Huge a+b}&pre=x&post=M",
|
||||
"Sizing": "http://localhost:7936/test/screenshotter/test.html?m={\\Huge x}{\\LARGE y}{\\normalsize z}{\\scriptsize w}",
|
||||
"Spacing": "http://localhost:7936/test/screenshotter/test.html?m=^3+[-1][1-1]1=1(=1)\\lvert a\\rvert~b",
|
||||
"Sqrt": "http://localhost:7936/test/screenshotter/test.html?m=\\sqrt{\\sqrt{\\sqrt{x}}}_{\\sqrt{\\sqrt{x}}}^{\\sqrt{\\sqrt{\\sqrt{x}}}^{\\sqrt{\\sqrt{\\sqrt{x}}}}}",
|
||||
"SupSubCharacterBox": "http://localhost:7936/test/screenshotter/test.html?m=a_2f_2{f}_2{aa}_2{af}_2",
|
||||
"SupSubHorizSpacing": "http://localhost:7936/test/screenshotter/test.html?m=x^{x^{x}}\\Big|x_{x_{x_{x_{x}}}}\\bigg|x^{x^{x_{x_{x_{x_{x}}}}}}\\bigg|",
|
||||
"SupSubOffsets": "http://localhost:7936/test/screenshotter/test.html?m=\\displaystyle \\int_{2+3}x f^{2+3}+3\\lim_{2+3+4+5}f",
|
||||
"Text": "http://localhost:7936/test/screenshotter/test.html?m=\\frac{a}{b}\\text{c~ {ab} \\ e}+fg",
|
||||
"VerticalSpacing": "http://localhost:7936/test/screenshotter/test.html?pre=potato<br>blah&post=<br>moo&m=x^{\\Huge y}z"
|
||||
}
|
32
test/screenshotter/test.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Huxley test</title>
|
||||
<script src="/katex.js" type="text/javascript"></script>
|
||||
<link href="/katex.css" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
#math, #pre, #post {
|
||||
font-size: 4em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span id="pre"></span>
|
||||
<span id="math"></span>
|
||||
<span id="post"></span>
|
||||
<script type="text/javascript">
|
||||
var query = {};
|
||||
var re = /(?:^\?|&)([^&=]+)(?:=([^&]+))?/g;
|
||||
var match;
|
||||
while (match = re.exec(window.location.search)) {
|
||||
query[match[1]] = decodeURIComponent(match[2]);
|
||||
}
|
||||
var mathNode = document.getElementById("math");
|
||||
katex.render(query["m"], mathNode, {
|
||||
displayMode: !!query["display"]
|
||||
});
|
||||
document.getElementById("pre").innerHTML = query["pre"] || "";
|
||||
document.getElementById("post").innerHTML = query["post"] || "";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|