Commit Graph

21 Commits

Author SHA1 Message Date
Fons van der Plas
8c2d852c4a fix(copy-tex): Use JS (instead of CSS) to select full equation, solving display glitches (#3586)
* copy-tex: Use JS to select full equation instead of CSS

* remove CSS

* Update webpack.common.js

* more build tweaks

* Update contrib/copy-tex/copy-tex.js

Co-authored-by: Erik Demaine <edemaine@mit.edu>

* Document new behavior

BREAKING CHANGE: copy-tex extension no longer has (or requires) a CSS file.

* Code cleanup, lint fixes, port to Flow

* Rewrite to extend both start and end of range

* Remove contrib/**/*.css linting

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2022-06-06 12:09:30 -04:00
renovate[bot]
e5e165c467 chore(deps): update dependency css-loader to v6 [skip netlify] (#3129)
* chore(deps): update dependency css-loader to v6 [skip netlify]

* build: use asset modules

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2021-08-07 01:58:01 +00:00
ylemkimon
c0a9a6d961 chore(deps): update to webpack 5 (#2664)
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-12-28 22:45:05 -05:00
renovate[bot]
16a34c3b35 chore(deps): update dependency flow-bin to v0.134.0 [skip netlify] (#2533)
* chore(deps): update dependency flow-bin to v0.134.0 [skip netlify]

* Fix flow errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Young Min Kin <mail@ylem.kim>
2020-09-26 12:19:42 +09:00
renovate[bot]
11c1e83579 chore(deps): update dependency postcss-loader to v4 (#2511)
* chore(deps): update dependency postcss-loader to v4

[skip netlify]

* Add postcss dependency

* Add postcssOptions

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Young Min Kin <mail@ylem.kim>
2020-09-12 13:46:00 +09:00
ylemkimon
f97c5454f8 chore: migrate to Yarn 2 (#2316)
* chore: migrate to Yarn 2

* Update config.yml
2020-08-03 18:24:56 +09:00
ylemkimon
591bc7b4be feat(css): use postcss-preset-env (#2313)
* Use postcss-preset-env

Closes #1946.

* Remove CSS prefixes

They are added by autoprefixer, if necessary.
2020-08-03 13:19:09 +09:00
ylemkimon
8a24907518 build(deps): update dependencies (#2301)
* Bump flow version

* Bump jest version

* Bump eslint version

* Bump rollup version

* Bump webpack version

* Bump misc dependencies and update lockfile

* Update lockfile

* Bump commander version

* Bump misc dependencies

* Bump istanbul version

* Bump docusaurus version

* Update lockfile

* Explicitly declare dependencies

* Bump caniuse-lite version

* Update lockfile

* Bump commander version

* Bump webpack and css-loader version

* Bump flow version
2020-07-25 11:38:29 -07:00
Kevin Barabash
151376e8aa Port katex-a11y.js to KaTeX (#2062)
* copy katex-a11y.js from webapp to contrib/to-a11y-string.js

* first pass of updating to-a11y-string to use flow

* Set up test harness and write some tests
- add flow types for jest
- create wallaby config file
- add prettier as a dep and set up .prettierrc so that we use .toMatchInlineSnapshot() and have jest insert the snapshot for us
- add lots of TODOs (I'll create tickets for these later)

* Add some  to get the tests passing for now

* remove commented out parts of wallaby.js config file

* remove some stale strings, fix flow issue, add more coverage

* add , add few more tests, handle middle

* fix minor nits in tests

* rename to-a11y-string to render-a11y-string, updatte webpack config to build extension

* add test for \boxed

* remove commented out code
2019-08-02 11:24:51 -04:00
ylemkimon
f948947736 Add KaTeX version to stylesheet and troubleshooting guide (#1893)
* Add KaTeX version to stylesheet

* Add troubleshooting guide

* Update katex.less

[skip ci]
2019-04-18 22:10:19 +09:00
ylemkimon
ce3840d4ce Include only necessary fonts for target environment specified by Browserslist (#1674)
* Include only necessary fonts for target environment specified by Browserslist

Allow WOFF and WOFF2 to be controlled using environment variables

* Fix links

* Fix merge error

* Update dependencies

* Replace uglifyjs-webpack-plugin with terser-webpack-plugin

* Do not set `targets` if !isESMBuild
2018-12-02 17:51:13 -05:00
Ron Kok
64745b5c8a Add mhchem extension (#1436)
* A proposal for support of mhchem

* Create extension

* Add index

* Remove arrow function

* Fix lint errors in macros.js

* Remove mhchem from build

* Move code from macros.js to mhchem.js

* Add minified mhchem

* Remove arrow head mods. Disable eslint.

* Fix space handling

* Update code to mhchem v3.3.0

* Tweak arrows to reduce diff

* Raise \tripledash

* Edit docs and webpack

* Update package.json

* Remove wrap. Remove manual.

* Correct second brush stroke in \xrightleftarrows

* Added patch file

* Add import line

* Add mhchem to eslint ignore
2018-11-24 18:52:25 -05:00
ylemkimon
f628ca142b Generate ECMAScript module for contrib (#1624)
* Create separate entry point of copy-tex for webpack

* Update katex.webpack.js comment

* Generate ECMAScript for contrib

* Update dependencies

* Comment out documentations
2018-10-31 11:37:54 +09:00
ylemkimon
101501189c Enable environment variable USE_TTF to disable bundling TTF fonts (#1600)
* Use environment variable USE_TTF to disable bundling TTF fonts

* Do not bundle TTF fonts on CircleCI build
2018-08-13 13:12:33 +09: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
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
Erik Demaine
32fe81ae40 Enable output modules to be used in browser or Node (#1401)
This makes cli.js work again from the Node command line

Workaround from https://github.com/webpack/webpack/issues/6522
2018-06-02 19:33:46 -04:00
ylemkimon
25e07a7df6 Upgrade to webpack 4 (#1337) 2018-05-28 05:20:33 +02: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
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