Commit Graph

357 Commits

Author SHA1 Message Date
Martin von Gagern
2e0f11bdfa Reindent some comment code as well 2015-09-11 09:27:47 +02:00
Martin von Gagern
dae3a14744 Reindent environments
Since the previous commit deliberately avoided reindenting, this one here
does just that: reindenting the existing code.
2015-09-10 11:18:11 +02:00
Martin von Gagern
2a31a719ec Split up environments list into calls to defineEnvironment
Having one long array literal to contain the code of all environment
implementations is problematic.  It makes it difficult to add auxiliary
functions or data close to the function inside the list where it is needed.

Now the functions are no longer defined using such a literal, but instead
using calls to a "defineEnvironment" function which receives all the
relevant data.  Since each function call is independent from the others,
anything can go in between.

This commit deliberately avoided reindenting existing code to match the new
surroundings.  That way it is easier to see where actual changes happen,
even when not performing a whitespace-ignoring diff.
2015-09-10 11:14:00 +02:00
Kevin Barabash
8accf0f18a Merge pull request #342 from xymostech/rename-breakOnUnsupportedCmds
Rename breakOnUnsupportedCmds to throwOnError.
2015-09-01 18:49:33 -06:00
Emily Eisenberg
d6cec8a861 Rename breakOnUnsupportedCmds to throwOnError.
Also, the MathBb-chrome test changed, to what I believe is the correct
result? Not sure why it looked wrong before.

Test plan:
 - `make test`
 - take screenshots, see nothing changed.
2015-09-01 16:51:03 -07:00
Kevin Barabash
c428abca1e Merge pull request #292 from kevinb7/fonts-p3_mathml
Adds MathML support for math font commands.
2015-09-01 09:00:16 -06:00
Kevin Barabash
64e63d7546 Adds MathML support for math font commands.
This is part 3 or 3.  The first two pull requests added font metrics, HTML rendering, and screenshot tests.
2015-08-30 17:24:04 -06:00
Kevin Barabash
07dc11ccb0 Merge pull request #341 from gagern/pngRepack
(Re-)Create some more screenshots in a reproducible way
2015-08-30 16:32:58 -06:00
Martin von Gagern
9c2a391ff6 (Re-)Create some more screenshots in a reproducible way
When rebasing for 2e002ff37a I forgot to
re-create the screenshots based on the new parent.  As a consequence, the
font testing images from fd2d58fd80 were not
updated for Firefox and not even included for Chrome.

We still have the strange issue that Lap can result in one of two possible
screenshots, and while the previous commit recreated one of them, this one
here recreates the other.
2015-08-30 23:09:42 +02:00
Kevin Barabash
f488a7c48d Merge pull request #340 from gagern/pngRepack
Use jspngopt and pako to create reproducible PNG files for Chrome as well
2015-08-29 18:57:40 -06:00
Martin von Gagern
2e002ff37a Use jspngopt and pako to create reproducible PNG files for Chrome as well
The combination of jspngopt and pako should eliminate possible causes for
different PNG encodings, although the core reason for #325 remains unknown.
Pako has poorer compression rates than native libz, but optimization can
counter that effect, and actually reduce the size of the screenshots.

The screenshots for LimitControls and UnsupportedCmds on Firefox used to
exhibit subpixel rendering before, for reasons unknown.  The regenerated
versions don't exhibit this.  See #324 for a discussion.
2015-08-30 02:12:55 +02:00
Kevin Barabash
72027a1a56 Merge pull request #330 from xymostech/add-vert-separator
Add | column separators to arrays.
2015-08-28 10:29:26 -06:00
Emily Eisenberg
3a8adbf595 Add | column separators to arrays.
This adds the ability to add `|` to a column description and have
vertical separators be added. I added types to the column descriptions
and added some logic to handle the separators when building the vertical
lists of the array.

Test plan:
 - See the Arrays screenshot looks good.
 - `make test`
2015-08-28 08:50:42 -07:00
Kevin Barabash
1b5834d894 Merge pull request #334 from Khan/revert-333-gitter-badge
Revert "Add a Gitter chat badge to README.md"
2015-08-21 21:19:25 -06:00
Kevin Barabash
d772aab6d5 Revert "Add a Gitter chat badge to README.md" 2015-08-21 21:14:55 -06:00
Kevin Barabash
bc4c270220 Merge pull request #333 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-08-21 21:06:08 -06:00
The Gitter Badger
2af1ad2ffc Added Gitter badge 2015-08-22 02:55:03 +00:00
Kevin Barabash
2d9a6f323c Merge pull request #291 from kevinb7/fonts-p2_rendering
Adds math commands, HTML rendering, and screenshotter tests.
2015-08-19 22:07:34 -06:00
Kevin Barabash
fd2d58fd80 Adds math commands, HTML rendering, and screenshotter tests.
This is part 2 of 3.  Part 1 added new fonts metrics.  Part 2 will add MathML support and unit tests.
2015-08-19 22:04:34 -06:00
Kevin Barabash
f32d615813 Merge pull request #294 from gagern/symtypes
Fix symbol group types
2015-08-19 17:44:11 -06:00
Martin von Gagern
9942283db0 Fix incorrect symbol types
These symbols should have different types, according to symgroups.js
2015-08-19 22:57:05 +02:00
Martin von Gagern
1846929110 Add tool to check symbol group types against LaTeX
At the moment, the tool isn't suitable for automatic regression tests yet,
since some symbols will require human verification.  That might change in
the future though, with a list of manually verified symbols which can be
skipped in automatic verification.  For this reason the file got placed into
the test directory.
2015-08-19 22:56:41 +02:00
Kevin Barabash
cb9f765e06 Merge pull request #310 from gagern/ssYaml
Switch Screenshotter data from JSON to YAML
2015-08-18 21:00:20 -06:00
Kevin Barabash
1da8c8938b Merge pull request #323 from blaiprat/fontMetricsData_js
Generate fontMetricsData as JavaScript
2015-08-06 11:15:00 -07:00
Martin von Gagern
758f4a73d9 Merge remote-tracking branch 'origin/master' into ssYaml 2015-08-06 10:18:04 +02:00
Blai Pratdesaba
236b7925f1 Add missing semicolon at the end of fontMetricsData 2015-08-06 09:17:42 +01:00
Blai Pratdesaba
8cd71830c2 Generate fontMetricsData as JavaScript 2015-08-05 19:52:42 +01:00
Martin von Gagern
62a8b2d4e7 Whitelist keys to include in ss_data query strings 2015-08-03 22:45:22 +02:00
Kevin Barabash
b2d2df9bef Merge pull request #317 from JeffEverett/unsupported_commands
Added support for visual depiction of unsupported commands
2015-07-29 10:55:04 -07:00
Kevin Barabash
76d87e8f90 Merge pull request #319 from JeffEverett/fix_limit_controls
Fixed limit controls in textstyle
2015-07-29 09:05:39 -07:00
Kevin Barabash
4a507c40f1 Merge pull request #290 from kevinb7/fonts-p1_metrics
Adds font metrics to support font commands.
2015-07-29 09:04:33 -07:00
Jeff Everett
9b0f42ea50 Fixed limit controls in textstyle 2015-07-28 15:22:30 -06:00
Jeff Everett
e1c221273c Added support for visual depiction of unsupported commands 2015-07-28 00:50:08 -06:00
Kevin Barabash
4be3931cb5 Merge pull request #314 from JeffEverett/limits_and_nolimits
Add support for \limits and \nolimits controls
2015-07-24 19:53:55 -06:00
Jeff Everett
5d83bb8cc0 Added support for \limits and \nolimits controls 2015-07-24 19:33:09 -06:00
Kevin Barabash
0dc9eed1c4 Disable chrome screenshotter tests until we can determine why it's producing different results.
Test Plan:
- run `make screenshots` and verify that it doesn't start the chrome docker image

Auditors: alpert, emily
2015-07-22 22:12:39 -06:00
Kevin Barabash
bd275b85d7 Update make screenshots to run the new screenshotter
Test Plan:
- run `make screenshots` and verify that the screenshotter runs

Auditors: alpert
2015-07-22 22:06:16 -06:00
Kevin Barabash
476eebf3c5 Merge pull request #299 from gagern/delimiters
Provide more delimiters
2015-07-19 21:14:13 -06:00
Emily Eisenberg
2600587f78 Update master version numbers
Summary: Update the version numbers on master to <the-next-version>-pre.

Test plan:
 - ???

Auditors: kevinb, alpert
2015-07-16 14:20:29 -07:00
Emily Eisenberg
ce99abd1f2 Update Dockerfile for ttfautohint, update metrics
Summary:
Update the MathJaxFonts `Dockerfile` to enable the use of
`ttfautohint` which hints our fonts better. Also, fix the location that
batik is downloaded from, update some formatting in the `Dockerfile`,
and update the fonts and metrics.

Test Plan:
 - Compare a rendered `= - A z 4 \Longrightarrow \Sigma \Biggl(` in
   Chrome on Windows at font sizes 10px to 20px before and after this
   change.
 - See that characters look about the same, or better.
 - See that the screenshot tests didn't change in firefox (maybe firefox
   runs the same autohinting algorithm that we do?), and don't visually
   change in chrome

Reviewers: kevinb, alpert

Reviewed By: kevinb, alpert

Differential Revision: https://phabricator.khanacademy.org/D18977
2015-07-16 12:01:26 -07:00
Martin von Gagern
fb403fa9eb Switch Screenshotter data from JSON to YAML
Escaping TeX in JSON as query strings is a pain: you have to double all the
\\, you have to escape the & and the #, you can't easily include line breaks
for readability, and so on.  YAML solves most of these problems for most of
the situations.  Now each test case can be structured, while simple test
cases only consist of a line of verbatim TeX code, with no escaping.

The most troublesome items remaining are lines starting in { since in YAML
these would denote inline mapping types. We use block notation for these.
2015-07-16 08:57:17 +02:00
Kevin Barabash
a3031af307 Merge pull request #308 from gagern/selenium-images
Automatically start a development server
2015-07-15 07:50:37 -06:00
Kevin Barabash
e0c75df7b7 Merge pull request #309 from gagern/chromeScreenshotUpdates
Update chrome screenshots
2015-07-15 07:49:45 -06:00
Martin von Gagern
9752d02748 Automatically start a development server
This avoids one of the few requirements we have left: you no longer have to
start a KaTeX development server, the script will do it for you, using a
random port number.

To reproduce the old behaviour, explicitely state --katex-port=7936.
2015-07-15 15:41:29 +02:00
Martin von Gagern
b7e1581869 Update chrome screenshots
I forgot to re-create these after rebasing.
2015-07-15 15:40:31 +02:00
Kevin Barabash
a18db36296 Merge pull request #264 from gagern/selenium-images
Selenium images
2015-07-14 10:13:56 -06:00
Martin von Gagern
6f65f685f3 Add screenshots taken from Chrome 2015-07-14 18:09:58 +02:00
Martin von Gagern
5d155c75db Switch from own docker image to standard selenium images
Since the Selenium images are available for download, and downloading them
is usually faster than building them from scratch, this makes taking
screenshots easier.  Furthermore, since the Selenium image is not specific
to KaTeX, it could as well be used for other purposes, thus saving space
since a single image can be used in multiple projects.

This change also deals with the non-determinism in the Lap screenshot:
We detect the one known (and accepted) alternate rendering and change the
output file name to Lap_alt in this case.  So either Lap or Lap_alt gets
saved to, and if the image is different from both, then one of these files
will show a modification.  On the other hand, if it is equal to either of
these, then the matching one will get overwritten, showing no change.
2015-07-14 18:09:58 +02:00
Kevin Barabash
b1d5311898 Merge pull request #306 from gagern/browserifyUpdate
Update development server for new browserify version
2015-07-14 06:56:50 -06:00
Martin von Gagern
11970ee965 Update development server for new browserify version
Current browserify no longer accepts an options hash to the bundle method.
2015-07-14 09:51:20 +02:00