Commit Graph

25 Commits

Author SHA1 Message Date
ylemkimon
3f69de5036 Update NPM scripts and documentation (#1146)
* Group more test npm scripts into `test:`

* Update documentations on the development workflow

* Update .travis.yml to match updated NPM scripts

* Run npm install in Travis
2018-02-11 16:11:59 -05:00
ylemkimon
383a68b935 Remove Makefile and migrate to NPM scripts (#1135)
* Remove Makefile and migrate to NPM scripts

* Update documentation/.arclint

* Check node version in prestart

* Group test npm scripts into `test:`
2018-02-06 12:39:24 -05:00
ylemkimon
5f32b71c85 Use webpack to build files and webpack-dev-server for testing (#1068)
* Create a separate entry point for webpack

Created a webpack entry point for KaTeX, which imports katex.less. As
flow[1] and jest[2] doesn't support CSS modules natively, a separate
entry point is used and it is not flowtyped.

[1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
[2] https://facebook.github.io/jest/docs/en/webpack.html

* Use webpack to build files

* Made webpack.config.js export valid webpack configuration
* Use:
browserify -> webpack
babelify -> babel-loader
UglifyJS CLI -> UglifyJsPlugin
Less CLI -> less-loader
cleancss -> cssnano in css-loader
build/fonts -> file-loader
* Inline CSS(Less) using style-loader and export them using
ExtractTextPlugin
* Add `watch` npm script calling `webpack --watch`

* Improve local testing(webpack-dev-server)

* Made webpackDevServer export a valid webpack configuration
* Compile Less and inline CSS using less-loader and style-loader
* Instead of copying files serve files from /static and use file-loader
* Remove old server.js and its dependencies

* Use webpack-dev-server in Screenshotter

* Include contrib in webpack-dev-server

+ Moved common configurations to webpack.common.js

* Rename webpackDevServer.js to webpack.dev...

to be consistent, avoid confusion with webpack-dev-server and follow
webpack configuration naming convention.

* Remove unnecessary conditional output.path

* Use map instead of reduce

+ Add comments regarding function arguments

* Remove unnecessary mkdir and clean build/* before build

* Use katex as external dependency instead of global variable in contrib

Fixes #692.

* Unblock codes as they are built as a module

* Update package-lock.json

* Add comments regarding devServer option

* Lint renamed webpack.dev.js

a0d8b33

* Export ES6 module and expose its default export

* Revert "Browserify hotfix (#1057)"

This reverts commit f6b509123b.

* Enables colors on the console when running the dev server in Screenshotter

* Add context to webpack configuration

Allows webpack to be run from other directories

* Move `rm -rf build/*` to npm scripts

* Check dependencies before build

* Move UglifyJsPlugin into config creation

* Let webpack handle ES6 modules

Do not transform modules to commonjs in Babel. However Jest doesn't not
support ES6 modules, so transfrom modules to commonjs when NODE_ENV is
`test`.

* Add documentation on testing in IE 9 and 10 using webpack-dev-server

Changed version range to include IE-compatible version
2018-01-21 19:48:25 -05:00
Kevin Barabash
9e6eb3a219 replace dockers/MathJaxFonts with KaTeX/katex-fonts submodule (#891) 2017-11-28 07:25:03 -05:00
Kevin Barabash
dbc5a74ebd Allow test/lint scripts to run without requiring make (#878) 2017-09-13 10:01:39 -04:00
Kevin Barabash
12399da73d make 'names' accept only an array of strings, add warning comments about where new functions should be added 2017-09-02 15:11:44 -04:00
Hannah Blumberg
a787bcb257 Fix link in CONTRIBUTING.md.
This fixes `[preview page] (http://utensil-site.github.io/available-in-katex/)` (and instead makes `preview page` a link).
2017-08-25 11:43:12 -07:00
Kevin Barabash
361c500a7f Switch from jasmine to jest (#747)
Summary:
The reasons for switching to jest:
- easy snapshot testing so that we can easily verify the structure of the parse tree and MathML tree
- easy compilation of ES6 features for tests as we continue to expand our use of ES6

Test Plan:
- npm test
2017-07-11 14:16:26 -04:00
Erik Demaine
ebaa3feab3 Mention texcmp (#753) 2017-06-30 13:42:39 -04:00
Ron Kok
4f57d53f6e Show correct browser support (#737)
* Show correct browser support

KaTeX runs in IE 9 but not in IE 8. This PR edits the README and
Contributing files to reflect that fact.

Resolves issue #377.

* Show correct browser support

KaTeX runs in IE 9 but not in IE 8. This PR edits the README and
Contributing files to reflect that fact and adds Edge to browser list.

Resolves issue #377.
2017-06-25 17:50:31 -04:00
utensil
dcc3214527 Add a link to symbol/function support preview page 2015-10-20 16:25:02 +08:00
newman101
f039068fae Updated link label 2015-10-19 18:18:18 +01:00
newman101
bc4693a71b Resolved Issue #370 2015-10-19 16:57:04 +01:00
Kevin Barabash
f25829df58 Redirect people to gitter instead of freenode 2015-09-25 14:35:23 -07:00
Kevin Barabash
6cf8c5aacb add a link to Examining TeX page on wiki to CONTRIBUTING.md
Auditors: emily
2015-07-08 23:38:40 -06:00
Kevin Barabash
53b0a9ad7a Update CONTRIBUTING.md
added "Pull Requests" section with some guidelines, plus some addition code style guidelines.

fix grammar and be more specific about splitting large pull request

Update CONTRIBUTING.md
2015-07-03 10:14:06 -06:00
Emily Eisenberg
2f552af02d 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
2015-03-12 16:40:15 -07:00
Emily Eisenberg
aaeab1200c Add MathML rendering to improve accessibility
Summary:
This adds support for rendering KaTeX to both HTML and MathML
with the intent of improving accessibility. To accomplish this, both
MathML and HTML are rendered, but with the MathML visually hidden and
the HTML spans aria-hidden. Hopefully, this should produce much better
accessibility for KaTeX.

Should fix/improve #38

Closes #189

Test Plan:
 - Ensure all the tests, and the new tests, still pass.
 - Ensure that for each of the group types in `buildHTML.js`, there is a
   corresponding one in `buildMathML.js`.
 - Ensure that the huxley screenshots didn't change (except for
   BinomTest, which changed because I fixed a bug in `buildHTML` where
   `genfrac` didn't have a `groupToType` mapping).
 - Run ChromeVox on the test page, render some math. (for example,
   `\sqrt{x^2}`)
   - Ensure that a mathy-sounding expression is read. (I hear "group
     square root of x squared math").
   - Ensure that nothing else is read (like no "x" or "2").
 - Ensure that MathML markup is generated correctly and is interpreted
   by the browser correctly by running
   `document.getElementById("math").innerHTML =
   katex.renderToString("\\sqrt{x^2}");` and seeing that the same speech
   is read.

Reviewers: john, alpert

Reviewed By: john, alpert

Subscribers: alpert, john

Differential Revision: https://phabricator.khanacademy.org/D16373
2015-03-01 18:33:20 -08: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
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
1f9393476b Add CLA information in CONTRIBUTING.md
Auditors: alpert
2014-09-18 20:05:51 -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
032b8a63e6 Improve readme
Add good README and CONTRIBUTING files.

Auditors: alpert
2014-09-15 02:41:19 -07:00