Commit Graph

77 Commits

Author SHA1 Message Date
Kevin Barabash
c80017ba08 Release v0.13.0 (#2824) 2021-03-08 21:58:35 -05:00
Ron Kok
7fe6778d2d feat: Add {CD} to auto-render. (#2710)
* Add {CD} to auto-render.

* Semantic PR

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-12-28 22:56:59 -05:00
Ron Kok
5c44c47bd2 feat: Set Auto-render to recognize AMS environments without $$…$$ delimiters. (#2701)
* feat: Set Auto-render to recognize AMS environments without $$…$$ delimiters.

* Replace tab with spaces

* Treat AMS environments correctly.
2020-12-27 18:29:55 -05:00
Ron Kok
75a3af9725 feat: Support {CD} (#2396)
* Support {CD}

* Edit screenshotter test to fit on one page

* Update screenshots

* Remove bogus Safari screenshot

* Edit documentation to avoid tag conflicts and explain delimiters

* Add type annotations

* Add bogus safari screenshot

* Update with real Safari screenshot

* Set label vertical alignment

* Revise call to parseExpression() per PR 2085 changes to macro parsing

* Update Firefox screenshot

* Pick up review comments

* Add unit tests and snapshot.

* Tighten up label collection.

* Better loop index

* remove extra space

* Picked up comments. Added a parse check. Added a test.

Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
2020-12-27 13:45:31 -05:00
Paul Zinn-Justin
b34175bd92 fix: rewrite of splitAtDelimiters.js -- new fix for #2523 (#2679)
* rewrite of splitAtDelimiters.js -- new fix for #2523

* fix splitAtDelimiters test

* minor changes to splitAtDelimiters

* tweak the indentation a bit

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
2020-12-26 14:14:31 -05:00
Ron Kok
60aecbdfe2 feat: Support \vcenter and \hbox (#2452)
* Support \vcenter, \raise, \lower, and \hbox

* Update screenshots

* Edit docs for strict and hbox to

* Fix typo for \hbox to

* Update Safari screenshot

* Augment docs for \vcentcolon

* Edit vcenter MathML comment.

* Remove pointless class from vcenter MathML

* Withdraw \raise and \lower

* Updatae Chrome and Firefox screenshots

* Update Safari screenshot

* Delete allowedInArgument setting

Co-authored-by: ylemkimon <y@ylem.kim>

* Update Chrome and Firefox screenshots

* Update Chrome and Firefox screenshots take 2

* Update screenshot

Co-authored-by: ylemkimon <y@ylem.kim>
2020-11-14 18:45:14 +09: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
Ron Kok
d4324a724b docs: add warning re:defer to mhchem documentation (#2485)
* Add warning re:defer to mhchem documentation.

* Edit description of defer behavior.

* Add nuance to the explanation regarding `defer`.
2020-09-08 01:59:02 +09:00
Ron Kok
42cc5e507e feat: Support \phase (#2406)
* Support \phase

* Update screenshots

* Update documentation

* Add a11y test

* Edit MathML notation to phasorangle

* Move code to enclose.js

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-08-13 00:08:36 -04: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
ylemkimon
c387b9c747 v0.12.0 release (#2302)
* Release v0.12.0

Bump master to v0.12.1-pre

* Update CHANGELOG

* Uncomment ES module documentation

* Update CHANGELOG.md

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

* Update CHANGELOG.md

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2020-07-13 05:46:01 +09:00
Aleksey Nagovitsyn
81258c5040 Add "option" to ignoredTags (#2180) 2019-12-24 13:10:09 +09:00
ylemkimon
b1eeeecf91 Move \global and \def to functions (#2138)
* Add parseNode type `internal`

* Move \def and \newcommand to functions

* Fix Flow error

* Separate \global

Move \newcommand back to macros for now

* Rename assignment.js to def.js

* Update test cases

* Add comments

* Update a test case
2019-12-04 20:07:19 -05:00
ylemkimon
e5333ad04d Add HTML extension (#2082)
* Add html extension

* Fix flow error

* Update documentation

* Add tests

* Call buildA11yStrings for "html" node

* Throw ParseError when parsing \htmlData fails

* Improve documentation

* Add a screenshotter test

* Add dummy screenshot

* Update screenshots
2019-12-01 17:49:28 -05:00
Aleksey Nagovitsyn
1e3471b290 auto-render: do not touch text nodes w/o formulas (#2154) 2019-11-18 13:18:02 +09:00
Evan Widloski
166f1f6798 mathtex-script: Use html 'defer' attribute (#2069)
* Use html 'defer' attribute

Instead of putting the extension script tag at the bottom, we can use the `defer` attribute to execute the script after all other content is loaded.  It has [very good](https://caniuse.com/#feat=script-defer) browser support.

* fix checksums

* use sha384 hashes

* update to Katex 0.11.1
2019-09-28 00:58:04 +09:00
Michael Polyak
f03671ce61 Release v0.11.1 (#2098)
* Release v0.11.1

Bump master to v0.12.0-pre

* Update CHANGELOG.md for v0.11.1-release

* Update CHANGELOG.md with Changes section for v0.11.1-release
2019-09-18 08:40:01 -04:00
Kevin Barabash
1da7ef2210 Release v0.11.0 (#2071)
* Release v0.11.0

Bump master to v0.12.0-pre

* update CHANGELOG.md

* minor editors to CHANGELOG.md
2019-08-12 21:51:13 -04:00
Ron Kok
3b80e0123b Remove keyVals ParseNode type (#2067)
* Remove keyVals ParseNode type

* Fix render-a11y-string-spec.js
2019-08-03 17:20:47 -04: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
Erik Demaine
f63733a35e Document mhchem \cf not supported (use \ce instead) (#2008)
* Document mhchem \cf not supported (use \ce instead)

* Mention \cf -> \ce in support table
2019-07-05 02:02:09 -04:00
Kevin Barabash
f659544d62 Release v0.10.2 (take 4) (#1961)
* Release v0.10.2

Bump master to v0.10.3-pre

* update CHANGELOG

* add integrity hash to mhchem script in README

* tweaked CHANGELOG
2019-05-12 22:08:30 -04:00
ylemkimon
e016f4b940 Release v0.10.1 (#1856)
* Release v0.10.1

Bump v0.10.1 to v0.10.2-pre

* Update CHANGELOG.md
2019-02-22 13:34:15 +09:00
varkor
062a28f35a Fix invalid UTF-8 in mhchem/README.md (#1833)
* Fix invalid UTF-8 in mhchem/README.md

* Fix apostrophes in README.md
2019-01-13 11:21:50 -05:00
AlbertHilb
f10de9617e Add optional pre-process callback to the auto-renderer. (#1784)
* Add optional pre-process callback to the auto-renderer.

* Rewrite `preProcess` callback signature.

* Add test.

* Make test future-proof.

* Add root folder to the node module paths.
2018-12-23 18:29:59 -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
49f84f76e7 v0.10.0 release (#1751)
* Remove RC-versioned docs

* Release v0.10.0

Bump master to v0.10.1-pre

* Fix multiple occuring hash replacement

* Update SRI hashes

* Update CHANGELOG.md

* Fix tags not shown

* Update docusaurus

* Wrap escaping backslashes with backticks

* Update SRI hashes

* Update CHANGELOG.md
2018-10-29 13:14:24 +09:00
ylemkimon
89daa02fd8 Move to katex.org (#1680)
* Change links to katex.org

* Change http to https

* Remove baseUrl hacks

* Fix OpenGraph image link

* Fix KaTeX path update script
2018-08-31 04:08:02 -04:00
ylemkimon
7ca6f51b9a Release v0.10.0-rc.1 (#1654)
Bump master to v0.10.0-pre
2018-08-23 02:42:24 +09:00
ylemkimon
e790a416d5 Update SRI hashes for v0.10.0-rc (#1638) 2018-08-19 11:50:31 -04:00
ylemkimon
293af2936d Release v0.10.0-rc (#1634)
* Release v0.10.0-rc

Bump master to v0.10.0-pre

* Update CHANGELOG.md

* Update SRI hashes

* Update SRI hashes
2018-08-20 00:25:11 +09:00
ylemkimon
52f3c05ccc Fix copying options in auto render (#1623) 2018-08-18 07:55:15 -04:00
ylemkimon
9a9842886e Remove Object.assign() in auto-render which requires expensive polyfill, update LICENSE (#1591)
* Remove Object.assign() in auto-render which requires expensive polyfill

* Remove underscore.js from LICENSE

* Rename to LICENSE and update year

* Lint `contrib` codes
2018-08-13 01:29:22 +09:00
ylemkimon
e4db097f0c Enable stylelint-config-standard, lint CSS files (#1575) 2018-08-09 13:10:30 -04:00
ylemkimon
ed7ad8d116 Add Extensions to Libraries documentation, dedupe auto-render documentation (#1566)
* Add extensions to libs.md

* Remove documentations from auto-render/README.md

* Add colons
2018-08-08 11:28:45 -04:00
Oliver Tacke
02639b424e Add ignore option for class names (#1555)
* Add ignore option for class names

This change adds another option for ignoring nodes for rendering similar to `ignoreTags`.
The new option `ignoreClasses` can hold an array of strings representing class names that should be ignored if they are in a node's class list. This can be desirable in dynamic environments.

* Adhere to CI rules for styling

* Add documentation for new option

* Exchange classList property with IE9 compatible code

* Harmonize variable names

* Add default for ignoredClasses
2018-08-08 09:00:22 +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
Erik Demaine
a7682e6220 Update READMEs to v0.10.0-beta (#1423)
8624d4ccff
2018-06-14 22:43:05 -04:00
Erik Demaine
ffe90a3ca1 Support \gdef in multiple equations in auto-render (#1425)
Within a single call to `renderMathInElement`, default `macros` to a shared
empty object (same as if you specified an object) so that global macros
defined via `\gdef` can be defined and shared.
2018-06-14 06:44:43 -04:00
Ron Kok
978148ec6e Fix auto-render \\[…] bug (#1375)
Fixes issue #1075.

Currently, a row separator such as `\[0.3em]` will cause the auto-render extension to fail if the row separator is placed between `\(…\)` math delimiters.

This PR re-orders the array of left delimiters that get searched for, putting `\[` last in the list.  This, `\\[0.3em]` is no longer mistaken for a math delimiter.
2018-05-29 15:31:23 +09:00
Erik Demaine
d9fe716d0e Update contrib READMEs to jsdelivr v0.10.0-alpha (#1362)
This is particularly important as update-sri.js only updates jsdelivr links.

I was able to get update-sri.js to do the heavy lifting (computing checksums)
after updating the links in general, and downloading v0.10.0-alpha from CDN.
2018-05-26 21:54:43 +02:00
Kevin Barabash
298b482c18 Bump master to v0.10.0-pre 2018-02-18 16:55:16 -05:00
Kevin Barabash
cf6743b2a8 Bump master to v0.10.0-pre 2018-01-28 23:41:01 -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
ylemkimon
4a11c3166d Move auto-render-spec.js to ./test (#1071)
Fixed jest not running auto-render-spec.js
+ Changed `require` to `import`
2018-01-17 08:44:48 -08:00
Kevin Barabash
0599e09a2d Bump master to v0.10.0-pre 2018-01-14 17:39:59 -05:00
Erik Demaine
d6609f7319 Make a more working example in README. Fix #1049 (#1050)
This is an attempt to flesh out the required <head> tags needed to make a full
working example of autorender, including KaTeX itself, to help people get
started with KaTeX.
2017-12-31 17:01:30 -07:00
Kevin Barabash
2ca6c3c73b Bump master to v0.10.0-pre 2017-11-26 18:34:59 -05:00