mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 06:28:40 +00:00
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
This commit is contained in:
32
test/screenshotter/test.html
Normal file
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>
|
Reference in New Issue
Block a user