268 Commits

Author SHA1 Message Date
greenkeeper[bot]
4e53f9d059 Update eslint-plugin-transform-runtime-aliasing to the latest version 🚀 (#1608)
* chore(package): update eslint-plugin-transform-runtime-aliasing to version 1.0.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2018-08-13 18:30:46 +09:00
ylemkimon
fdb155aa97 Build ECMAScript modules (#1479)
* Separate type import statement from module import statement

* Remove extension from import statements

* Build ECMAScript modules

* Add `cross-env` devDependency

* Use `babel-plugin-import-rename` instead of custom plugin

* Improve `.babelrc` style and add comments

* Update README.md

* Change file extension to `.mjs`

Comply with Node.js spec. Use extensionless package:main.

* Enforce only ESM compatible imports

* Dedupe packages

* Add `unicodeMake.js` to overrides:excludedFiles

* Fix .eslintrc merge conflict

* Use rollup to bundle ES module

* Remove `eslint-plugin-import`

* Change build directory to `dist`

* Change build directory to `dist`

* Change build directory

* Move docs from README.md to browser.md

* Update update-sri.js

* Revert update-sri.js

* Revert update-sri.js

* Update .eslintrc

* Remove SSH key testing
2018-08-13 13:06:40 +09:00
ylemkimon
295d933845 Enable greenkeeper-lockfile (#1531)
* Enable `greenkeeper-lockfile`

* Change colon to dash

* Fix command path

* Add SSH key
2018-08-12 23:55:19 -04:00
ylemkimon
7f1ce374e0 Lint against function polyfills that may be expensive (#1597)
* Lint against polyfills that may be expensive

* Exclude test file from source code linting
2018-08-13 11:26:46 +09:00
Erik Demaine
881d780287 Rename Screenshotter -> screenshotter (#1573)
Fix #1570
2018-08-10 19:29:16 +09:00
ylemkimon
e4db097f0c Enable stylelint-config-standard, lint CSS files (#1575) 2018-08-09 13:10:30 -04:00
greenkeeper[bot]
8fb92f6866 chore(package): update postcss-loader to version 3.0.0 (#1572)
* chore(package): update lockfile
2018-08-09 12:58:06 +09:00
greenkeeper[bot]
0b8277c37b chore(package): update style-loader to version 0.22.0 (#1561)
* chore(package): update lockfile
2018-08-08 17:56:00 +09:00
greenkeeper[bot]
ddddd3ad8c chore(package): update flow-bin to version 0.78.0 (#1545) 2018-08-03 21:16:00 -04:00
ylemkimon
c06b36cb6a Replace yarn run and yarn install with yarn, remove building with npm instructions (#1528)
* Replace `yarn run` with `yarn`

* Replace `yarn install` with `yarn`

* Remove building using `npm` from node.md
2018-07-30 14:31:25 +09:00
ylemkimon
a76c4b9a2f Switch npm to Yarn (#1522)
* Add testUrl to jest config

* Switch npm to Yarn
2018-07-29 11:36:27 -07:00
ylemkimon
edede0867d Add codecov as devDependencies (#1524)
* Add codecov as devDependencies

* Update CI commands
2018-07-30 02:15:25 +09:00
ylemkimon
db2aecce24 Lint website (#1519)
* Lint website

* Add comment to empty_thead.js
2018-07-28 10:49:36 -04:00
Erik Demaine
9fe5e221e5 Switch from nomnom to commander (#1496)
* Switch from nomnom to commander

* Fix #1489
* --macro repeatable option replaced with single --macros option with ";"
  separator (until https://github.com/tj/commander.js/issues/674)
* Add missing --max-expand option
* Replace expired --unicode-text-in-math-mode option with --strict
  (https://github.com/Khan/KaTeX/issues/1483#issuecomment-405108291)
* Add instructions for how to run in the opening comments
* Clean up option doc strings

* Implement @ylemkimon's comments

* Fix try/const bug

* Fix use of --selenium-ip

It was a quirk that --seleniumIP worked.  --help lists --selenium-ip.

* Implement comments, restore --macro repeatable argument

* Cleanup

* Restore 0 default for maxExpand

* Fix more comments from @ylemkimon

* npm run dist -> npm run build

In preparation for #1500

* Fix line length error
2018-07-23 13:16:45 -04:00
ylemkimon
237986a7ca Change build directory to dist and cleanup NPM scripts (#1500)
* Move the build path to `dist`

* mkdir dist if not exists

* Remove build from .gitignore

* Delete `dist/` before building and when cleaning
2018-07-23 12:46:15 -04:00
greenkeeper[bot]
78870abbe8 Update css-loader to the latest version 🚀 and use postcss-loader and cssnano to minimize CSS (#1464)
* chore(package): update css-loader to version 1.0.0

* Require minimum Node 6.9

* Use `postcss-loader` and `cssnano` to minimize CSS

* chore(package): update lockfile

* Remove unnecessary `ident` and function

* chore(package): update cssnano to version 4.0.1
2018-07-22 15:37:19 +09:00
greenkeeper[bot]
e5cb511f5a chore(package): update flow-bin to version 0.77.0 (#1493)
* chore(package): update lock file
2018-07-21 20:18:44 +09:00
ylemkimon
48e9058a06 Inline version using babel-plugin-version-inline (#1475)
* Inline version using `babel-plugin-version-inline`

* Fix `unicodeSymbols.js` generation
2018-07-16 03:41:03 +09:00
ylemkimon
0fb71c8bf8 Lint webpack.*.js (#1467)
* Lint webpack.*.js

* Fix webpack.analyze.js style
2018-07-07 13:17:05 -04:00
greenkeeper[bot]
00c91cdc35 chore(package): update flow-bin to version 0.76.0 (#1465)
* chore(package): update flow-bin to version 0.76.0

* chore(package): update lockfile
2018-07-08 00:07:14 +09:00
ylemkimon
518379aed5 lexer: Remove match-at dependency, use RegExp (#1447)
* lexer: Remove `match-at` dependency, use RegExp

* chore(package): update flow-bin to version 0.75.0

* Fix flow error

* Remove unused flow libs

* Minor fix

* Throw an error when `RegExp.exec` jumps
2018-06-28 03:13:27 +09:00
greenkeeper[bot]
6195f2f176 chore(package): update eslint to version 5.0.0 (#1448)
* chore(package): update eslint to version 5.0.0

* chore(package): update lockfile
2018-06-23 13:26:02 +09:00
ylemkimon
3f1b13e352 Fix Webpack global function definition, including hot module replacement (#1435)
* Upgrade webpack-cli to 3.0.1

* Wrap output.globalObject in parentheses

Fix global function definition, such as hot module update.
2018-06-17 08:19:02 -04:00
greenkeeper[bot]
f929f0a683 chore(package): update flow-bin to version 0.74.0 (#1414) 2018-06-07 14:33:23 -04:00
Erik Demaine
4f9851fb0c Automatic submodule updating via husky tool (#1391)
* Automatic submodule updating via husky tool

* Update documentation
2018-06-04 20:22:12 -04:00
greenkeeper[bot]
59a25fe3d9 Update webpack-cli to the latest version 🚀 (#1397)
* chore(package): update webpack-cli to version 3.0.0

* chore(package): update lockfile
2018-06-02 14:54:29 -04:00
greenkeeper[bot]
659b4e30c8 Update dependencies to enable Greenkeeper 🌴 (#1368)
* chore: add Greenkeeper config file

* chore(package): update dependencies

* chore(package): update dependencies

* docs(readme): add Greenkeeper badge

* Exclude "dockers/texcmp/package.json",

* Revert "dockers/texcmp/package.json"

Reverts ddc6aa9e05d9e3a7e1e960c7c62f15b8dbff70a9
2018-05-28 05:37:36 +02:00
ylemkimon
25e07a7df6 Upgrade to webpack 4 (#1337) 2018-05-28 05:20:33 +02:00
Ashish Myles
e3fb2f95ae Update flow version and address type errors. (#1369) 2018-05-27 16:19:10 -04:00
ylemkimon
ef666c18da Update dependencies: less(-loader), uglifyjs-webpack-plugin, request (#1343) 2018-05-23 16:13:06 +02:00
Kevin Barabash
5aad11eff3 Bump master to v0.11.0-pre 2018-05-19 20:49:11 -04:00
Erik Demaine
a0ddad338e Support \tag, \tag*, and \gdef (#1309)
* Tag sketch

* Drop objectAssign; already using Object.assign elsewhere

* Basic \gdef support

* Bug fix

* Finish \tag

* MathML numbers equations with <mlabeledtr>

* Fix flow bugs

* \gdef tests

* Add basic \tag tests

* Screenshot test for \tag

* \tag* test

* Add missing file

* Bug fix screenshot

* Major refactor

* Represent tag at top level of parse tree, requiring less hackery
  * No more \@tag function; it was essentially just doing \text
* Wrap tag in group so e.g. ( and ) are formatted the same
* Add `feed` method to MacroExpander for multiple inputs (for tag)
* Bug fixes in buildHTML, makeTextRow, _getBuilt (for display mode)
* Remove excess <mrow> wrapper when unnecessary

* Update screenshot from tag being wrapped in group

* Add maxExpand limit
2018-05-19 22:19:21 +02:00
Erik Demaine
7b22eeb64a Move test helpers into common modules (#1318)
* Move test helpers into common modules

* helpers.js gets all the helper functions
* setup.js gets the common Jest setup (serializer, expect extensions)

* Exclude test from coverage testing

* @ylemkimon's comments: parsing -> building, settings || defaultSettings

* Default argument for settings

* Fix lint errors

* @ylemklemon's comment: use buildAndSetResult

* Use template literals
2018-05-18 09:45:19 -04:00
Erik Demaine
7ab4f76e16 Implement strict mode (replacing unicodeTextInMathMode) (#1278)
* Implement strict mode (replacing unicodeTextInMathMode)

Add new "strict" setting (default value false) that can take a boolean
(whether to throw an error or silently ignore), string ("ignore",
"warn", or "error"), or a function possibly returning such a value.
This enables a variety of ways of handling or ignoring transgressions
from "true" LaTeX behavior, making KaTeX easier to use while still
providing the ability for strict LaTeX adherance.

Resolve #1226, implementing that spec, for two existing
transgressions from regular LaTeX:

* src/functions/kern.js had some errors and warnings about use of
  (units in) math vs. text mode commands.
* The former setting unicodeTextInMathMode (not in any released version)
  needed to be set to true to enable Unicode text symbols in math mode.

Now these are controlled by the strict setting.  By default, KaTeX is now
very permissive, but if desired, the user can request warnings or errors.

* Rewrite strict description

* Add tests for strict functions

* Stricter type for strict

* Switch default strict setting to "warn"

* Fix new flow error

* Fix another flow bug
2018-05-13 14:27:30 -04:00
Hossein Saniei
bd7a977404 [plugin system] Add defineSymbol to the main katex object (#1263)
* Expose defineSymbol in the main KaTeX object

* More Unicode letters (#1260)

This PR serves as a complement to PR #1232 by supporting some letters that are omitted from the Unicode range 1D400–1D7FF.

* Include Bold-Italic fonts for \boldsymbol (#1257)

* Include Bold-Italic fonts for \boldsymbol

Fix #1228

* Update screenshots

* README: Add size badge (#1253)

* README: Add size badge

Add a size badge showing size of gzipped katex.min.js

* update-sri: Add code to replace size badge in readme

* Change to use badge from shields.io instead

My bad for assuming that badgesize.io supports https. Change to use the
badge from shields.io which supports https.

* More Unicode letters (#1260)

This PR serves as a complement to PR #1232 by supporting some letters that are omitted from the Unicode range 1D400–1D7FF.

* Include Bold-Italic fonts for \boldsymbol (#1257)

* Include Bold-Italic fonts for \boldsymbol

Fix #1228

* Update screenshots

* README: Add size badge

Add a size badge showing size of gzipped katex.min.js

* update-sri: Add code to replace size badge in readme

* Change to use badge from shields.io instead

My bad for assuming that badgesize.io supports https. Change to use the
badge from shields.io which supports https.

* Use badgesize.io with https

* Fix space width in \texttt (#1261)

* Fix space width in \texttt

Fix #1255 via https://github.com/KaTeX/katex-fonts/pull/41.
Also fix width metrics via https://github.com/KaTeX/katex-fonts/pull/42.

* Improve test

* Update screenshots
2018-04-28 16:36:30 -04:00
Erik Demaine
95ea3e3095 Fix cli.js: add nomnom dependency, add -u option (#1218)
* Fix cli.js: add nomnom dependency, add -u option

* Add `nomnom` dependency (not dev dependency): fix #1216
* Add -u option for new `unicodeTextInMathMode` option

* Reword color option doc

* Fix comments from review
2018-03-15 22:28:23 +09:00
Erik Demaine
75b55a63b1 Add display/displayMode toggle on test page (#1193)
* Add display/displayMode toggle on test page

* Fix #1035
* Refactor query parsing code to promote re-use
* Also add support for (unescaped) single-character macros

* Rewrite to use query-string

* Restore modes on package*json
2018-03-12 01:15:09 +01:00
Ryan Randall
017eb7b91d Implementing analyze script (#1197) 2018-03-09 17:13:02 +01:00
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
30854eb866 Enable hot module replacement(HMR) (#1100)
* Use ES6 in static/main.js

+ Lint static/main.js

* Enable hot module replacement(HMR) in webpack-dev-server

* Disable no-console in static/main.js

* Use seperate entry point/bundle for the test page(/static/main.js)
2018-02-01 13:33:49 -05:00
ylemkimon
58c4c7c4a4 Set webpack-dev-server host to 0.0.0.0 (#1122)
webpack-dev-server CLI has a default value of localhost, which only
allows accessing locally. Setting to 0.0.0.0 allows to access the server
from the external. However, the open option will open 0.0.0.0:7936,
which is an invalid address, so it has been removed.
2018-01-31 19:00:40 -05:00
Kevin Barabash
7b635f79cf move katex.less into src (#1120)
* move katex.less into src

* fix remaining paths for katex.less
2018-01-30 23:53:02 -05:00
Kevin Barabash
03c5ce7f87 add perf tests, fixes #1053 (#1054) 2018-01-29 20:38:14 -05:00
Kevin Barabash
bf080cd6a4 remove symlink to support devs using Windows (#1090) 2018-01-28 23:01:57 -05:00
Kevin Barabash
c627de04d9 use correct spacing with tight styles (#1106) 2018-01-27 22:12:25 -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
nickkolok
f6b509123b Browserify hotfix (#1057) 2018-01-14 17:16:12 -05:00
Erik Demaine
63733f796a Update testing infrastructure NPM packages (#1044)
* Update testing infrastructure NPM packages

Travis is currently failing all tests.  This should fix it,
as documented in https://github.com/eslint/eslint/issues/9767

* Add package-lock.json
2017-12-29 10:06:26 -07:00
Ryan Randall
50765a0ccd Stacking text commands (#1009)
* Adding support for SansSerif-Bold

* Updating to include SansSerif Italic.

* WIP

* Working text stacking

* More robust screenshot.

* Don't want to break users :)

* Updating per PR comments.

* Fixing Unicode and updating snapshots.

* Adding suggested tests.

* Opting to use old method for unit testing.

* Adding TODO
2017-12-13 09:10:23 -05:00