Commit Graph

419 Commits

Author SHA1 Message Date
Emily Eisenberg
4c00064f41 Merge pull request #142 from mathiasbynens/woff2
Add WOFF2 versions of the fonts
2014-10-03 16:38:56 -07:00
Emily Eisenberg
23d50e8633 Merge pull request #117 from jmeas/hi-jshint
Adds JSHint to the build step + code clean up
2014-10-01 18:53:39 -07:00
Jmeas
fec04614b8 Adds JSHint to the build system and tidies up code. 2014-10-01 21:28:46 -04:00
Emily Eisenberg
6aa70e33e4 Merge pull request #137 from cben/displaystyle
Mention `\displaystyle` workaround in README
2014-10-01 15:06:02 -07:00
Emily Eisenberg
def1a47935 Add optional arguments
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
2014-10-01 14:20:47 -07:00
Ben Alpert
cba70b51fe Make built files use only ASCII characters
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
2014-10-01 14:07:11 -07:00
Beni Cherniavsky-Paskin
80c4ca7c71 Mention \displaystyle workaround in README
until the question of display math API (#66) is decided either way...
2014-10-01 18:58:26 +03:00
Mathias Bynens
48870f05c1 Add WOFF2 versions of the fonts
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.
2014-10-01 11:54:53 +02:00
Jmeas
4da05ab772 Adds new symbols. 2014-09-29 13:42:19 -04:00
Emily Eisenberg
5722b45633 Merge pull request #101 from kevinb7/over
added support for \over
2014-09-27 01:32:30 -07:00
Kevin Barabash
c566ae6888 added support for \over
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
2014-09-26 15:31:45 -06:00
Kevin Barabash
0189b96b92 added rule to the style guide section for where to declare variables 2014-09-25 14:32:37 -06:00
Ben Alpert
0236cdc619 Merge pull request #107 from dbieber/patch-2
Update CONTRIBUTING.md
2014-09-24 11:28:21 -07:00
Ben Alpert
5e535af75f Merge pull request #106 from dbieber/patch-1
Update CONTRIBUTING.md
2014-09-24 11:25:45 -07:00
Ben Alpert
240981e3a2 Merge pull request #70 from mathiasbynens/patch-1
README: Remove redundant `type` attribute
2014-09-23 22:16:25 -07:00
Emily Eisenberg
a18adfdfad Merge pull request #104 from kevinb7/error.position
added position property to ParseError
2014-09-23 14:04:17 -07:00
Kevin Barabash
afaec30d0a added position property to ParseError 2014-09-23 14:38:41 -06:00
David Bieber
5916e1287d Update CONTRIBUTING.md 2014-09-22 21:07:11 -07:00
David Bieber
bd795020f0 Update CONTRIBUTING.md
fix spelling of install
2014-09-22 21:05:19 -07:00
Emily Eisenberg
e0dece759f Merge pull request #91 from MandaBrown/teeny_tiny_typo_fix
Fixes a teeny tiny typo in a comment.
2014-09-22 14:25:28 -07:00
Emily Eisenberg
bd6f762f94 Improve the fonts.less experience
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
2014-09-22 14:23:23 -07:00
Emily Eisenberg
824fb7fd2f Update huxley screenshots
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
2014-09-22 13:58:19 -07:00
Ben Alpert
317564a173 Catch exceptions on test page
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
2014-09-22 11:46:26 -07:00
Mandy Brown
fdc578563b Fixes a teeny tiny typo in a comment. 2014-09-19 21:29:50 -04:00
Emily Eisenberg
d2f41a19a5 Merge pull request #89 from patrickkang/master
Add \partial symbol
2014-09-19 12:34:00 -07:00
Emily Eisenberg
b675587259 Merge pull request #71 from jmendeth/simple-cli
Simple CLI
2014-09-19 11:51:06 -07:00
Emily Eisenberg
bd6ebf23dd Merge pull request #54 from adammark/patch-1
Update README.md
2014-09-19 11:49:02 -07:00
Patrick Kang
b9333a36d1 Add partial symbol 2014-09-19 14:14:46 -04:00
Emily Eisenberg
73c33b015a Merge pull request #72 from evestera/setrelops
Added set theory and logic symbols
2014-09-18 22:06:33 -07:00
Erik Vesteraas
840ab70191 Added various set theory and logic symbols
\subset, \supset, \subseteq, \supseteq, \cap, \cup, \setminus,
\neg, \lnot, \top, \bot, \emptyset, \varnothing, \land, \lor,
\wedge, \vee, \notin, \nsubseteq, \nsupseteq, \models
2014-09-19 06:59:59 +02:00
Emily Eisenberg
5476c849c9 Merge pull request #44 from grizzilus/master
Fix license typo in README
2014-09-18 21:03:11 -07:00
Emily Eisenberg
1f9393476b Add CLA information in CONTRIBUTING.md
Auditors: alpert
2014-09-18 20:05:51 -07:00
Emily Eisenberg
ea5ee95dbe Warn when the website is in quirks mode
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
2014-09-17 15:13:56 -07:00
Xavier Mendez
8bd9bfbcfe Ignore NPM debug logs
Not related to this PR, but good to have.
2014-09-17 15:47:04 +02:00
Xavier Mendez
f6dd9e93fb Add simple CLI 2014-09-17 15:46:20 +02:00
Mathias Bynens
2ab395a55f README: Remove redundant type attribute 2014-09-17 15:39:11 +02:00
Emily Eisenberg
b7e55607cc Add skew and italic metrics for ttfs
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
2014-09-16 17:40:20 -07:00
Emily Eisenberg
e6b3cbe7c1 Add font metrics for \iint, \iiint
Also, fix the python dict keys so we actually get the metrics back into the
javascript correctly.

Fixes #56

Auditors: alpert
2014-09-16 16:00:30 -07:00
Adam Mark
5cfa59e5b6 Update README.md
Must specify UTF-8 in document for math characters to render properly.
2014-09-16 11:17:18 -04:00
Jeremy Engel
199bc00385 Fix license typo in README 2014-09-15 18:05:10 -07:00
Emily Eisenberg
aa7052d03a Merge pull request #39 from mgp/master
Fix links to JS source files
2014-09-15 13:24:28 -07:00
Mike Parker
faf69f238a Fix links to JS source files
These links were missing the `src` path component.
2014-09-15 12:51:29 -07:00
Emily Eisenberg
f76688b639 Bump version to v0.1.0
Also ready KaTeX for releasing

Auditors: alpert
2014-09-15 03:04:11 -07:00
Emily Eisenberg
35d9d972fd Move js files into src/
Test plan:
- Make sure huxley tests, jasmine tests, make build, make metrics, make test all
  still work.

Auditors: alpert
2014-09-15 02:50:34 -07:00
Emily Eisenberg
032b8a63e6 Improve readme
Add good README and CONTRIBUTING files.

Auditors: alpert
2014-09-15 02:41:19 -07:00
Emily Eisenberg
38a6ce7990 Add a Dockerfile for huxley tests
Summary:
Add the dockerfile that I've been using to make huxley screenshots so
others can test their changes by making huxley screenshots. Include a readme
about how to use it correctly.

Test Plan: - Use the dockerfile by running the given commands, see it works

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D12773
2014-09-14 21:30:06 -07:00
Emily Eisenberg
6b674873ea Rename katex.process to katex.render
Test plan:
 - Make sure tests work and huxley tests didn't change

Auditors: alpert
2014-09-14 21:20:27 -07:00
Emily Eisenberg
9dc767041d Improve build process
Summary:
Improve the build process by combining the CSS files, automatically
selecting font files to include, and building .tar.gz and .zip files.

Test Plan:
 - Make sure tests work
 - Make sure huxley screenshots didn't change
 - Make sure zip and tar.gz files contain only files we want to distribute

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13159
2014-09-14 19:31:38 -07:00
Emily Eisenberg
f63af87f17 Add looots of comments
Summary:
Add comments everywhere! Also fix some small bugs like using Style.id
instead of Style.size, and rename some variables to be more descriptive.

Fixes #22

Test Plan:
 - Make sure the huxley screenshots didn't change
 - Make sure the tests still pass

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13158
2014-09-14 19:23:39 -07:00
Ben Alpert
79a5687057 Add Travis badge to README
Auditors: emily
2014-09-14 16:02:52 -07:00