Before, it only depended on `static/katex.less`. Now, make it a little
less general and depend on all less files, in case we add more in the
future.
Auditors: alpert
Summary:
To complement pull request #142, add the ability to automatically
generate the woff2 files from within the docker. Add a script for copying out
the generated font files to make things easier. Remove the KaTeX_Greek font
files as well as the KaTeX_Win ones, since we don't use them and they're oddly
non-woff and non-eot specific?
Test Plan:
- Build a new docker from the new Dockerfile
- Make sure the woff2_compress program compiles
- Follow the instructions in the README to build the fonts
- Make sure the fonts correctly build
- Make sure the copy_fonts.sh script copies the fonts out
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13637
Summary:
Add correct parsing of optional arguments. Now, things like `\rule` can shift
based on its argument, and parsing of `\sqrt[3]{x}` fails (correctly) because we
don't support that yet.
Also, cleaned up the lexing code a bit. There was a vestige of the old types in
the lexer (they have now been completely moved to symbols.js). As a byproduct,
this made it hard to call `expect("]")`, because it would look at the type of
the Token and the type for "]" was "close". Now, all functions just look at the
text of the parsed token, and in special occasions (like in the dimension lexer)
it can return some data along with it.
Test Plan:
- Make sure tests still work, and new tests work
- Make sure no huxley screenshots changed
- Make EXTRA SURE `\sqrt[3]{x}` fails.
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13505
Test Plan: Searched for `[^\x00-\x7f]` in vim and had no results, where there were before.
Reviewers: emily
Reviewed By: emily
Differential Revision: http://phabricator.khanacademy.org/D13459
Contrary to other web font formats, the new WOFF 2.0 Web Font compression format is optimized for file size, memory usage, and decompression speed.
WOFF2 has been supported in Chrome and Opera for a while now. See https://dev.opera.com/blog/opera-23/ for more info.
changed stopType (string) parameter to breakOnInfix (boolean)
renamed rewriteInfixNodes to handleInfixNodes
added a test for {1 \over 2} \over 3, fixed some grammar, and added code in the parser to squash superfluous ordgroups
removed squashOrdGroups and instead don't create an "ordgroup" if one already exists
removed unnecessary variable
moved variable declarations out of "if" statements
removed comment
Fixed style issue with where variables are declared and remove unnecessary comment from functions.js
Summary:
Create a fonts.less file which generates identical css to fonts.css, but using
less rules to be more understandable and customizable. For example, add the
ability to change where the fonts directory is located (instead of mandating it
be located next to the less file), and add the ability to disable specific font
formats (like disable EOTs when IE8 support isn't needed).
Test Plan:
- Ensure that the test page and huxley page still work
- Ensure that the output of `./node_modules/.bin/lessc static/fonts.less` is
the same as the original css by running both through
`./node_modules/.bin/cleancss` and diffing them.
- Ensure that the huxley screenshots haven't changed
- Ensure that the build step still works
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13326
Update huxley, and then use the Dockerfile to create new huxley screenshots.
Test plan:
- Make sure generating new huxley screenshots works
- Ensure that re-generating huxley screenshots produces no changes
Auditors: alpert
Summary: This makes typing into the box bearable with break-on-exception enabled.
Test Plan: Typed into box; I didn't blow up.
Reviewers: emily
Reviewed By: emily
Subscribers: jessie
Differential Revision: http://phabricator.khanacademy.org/D13314
Summary:
KaTeX doesn't work correctly in quirks mode. Warn in the console and disable
rendering if that happens.
Test Plan:
- Make sure the test still loads and renders math
- Make sure a warning is thrown when the doctype is removed, and no more math
is rendered
- Make sure the tests pass both on the web and with `make test`
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13192
Summary:
Add the ability to base the metrics for a TTF character on the metrics
from one of the TFM characters.
Test Plan:
- Make sure the tests still work
- Make sure huxley tests didn't change
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13217