Commit Graph

1062 Commits

Author SHA1 Message Date
ylemkimon
e97a23ec6d Set baseUrl depending on the environment (#1526) 2018-07-29 11:04:32 -07:00
ylemkimon
cd80db5ded Fix docUrl and pageUrl in the Footer & image path (#1514)
* Fix docUrl and pageUrl in the Footer

* Fix katex-comparison.gif path

* Fix typo in the url to `supported`
2018-07-29 13:40:10 -04:00
ylemkimon
edede0867d Add codecov as devDependencies (#1524)
* Add codecov as devDependencies

* Update CI commands
2018-07-30 02:15:25 +09:00
ylemkimon
2136c9670c Remove .travis.yml and related (#1523) 2018-07-29 13:07:40 -04:00
ylemkimon
20c9440318 Add markdown-help command and auto-generate CLI documentation (#1518)
* Add `markdown-help` command and update CLI documentation

* Auto-generate cli.md before start, build, and publish

* Update cli.md.template
2018-07-30 01:44:43 +09:00
ylemkimon
c1b6668cf0 Improve README.md (#1515)
* Fix KaTeX logo

* Add npm badge

* Change CircleCI badge

* Remove redundant links

* Remove unnecessary details

* Add a link to auto-render extension

* Add a link to the list of supported commands

* Add a section about auto-render extension

* Update README.md
2018-07-29 12:26:41 -04:00
Ron Kok
3cce293a02 Add size graphic to function support page, fix vertical alignment (#1517)
* Add size graphic to supported

* Add indents

* Fix environment vertical alignment
2018-07-29 02:43:15 +09:00
ylemkimon
db2aecce24 Lint website (#1519)
* Lint website

* Add comment to empty_thead.js
2018-07-28 10:49:36 -04:00
ylemkimon
4114288403 Improve supported functions documentation (#1511)
* Remove empty lower right cells

* Escape backticks(`) using <code></code>

* Escape vertical bars(|) using <code> and HTML entity code

* Normalize documentation links

* Remove empty thead
2018-07-27 18:23:49 -07:00
ylemkimon
8a38035855 KaTeX website & documentation (#1484)
* website/docs: initial commit

* Change secondaryColor

* Fix index.css not being copied and included on global stylesheet

* Fix stylesheet link

[skip ci]

* Change documentation link to API(Usage)

[skip ci]

* Add `Libraries` in usage

[skip ci]

* Remove documentation from `README.md` and add link to the site

[skip ci]

* Use KaTeX in the parent directory to build Markdown

[skip ci]

* Revise function support page. Avoid error msgs.

* General edit to function support page
2018-07-26 20:19:40 -07:00
ylemkimon
83e8eac0a5 Add test job to CircleCI (#1235)
* Do not compile contrib when running screenshotter

* Add test job to CircleCI

* Update config.yml

* Fail if PR exists but running on the forked repo

* Update Screenshotter README.md

* Store artifact at the root

* Add CircleCI badge

* Add `codecov` to CircleCI

* Change build directory to `dist`
2018-07-26 18:50:51 -07:00
Erik Demaine
e454eb3b3e Screenshotter chdir to KaTeX root directory (#1502)
* Screenshotter chdir to KaTeX root directory

Fix #1501.  This seems to be required for webpack, specifically
`babel-plugin-version-inline`, to run correctly.

* lint fix
2018-07-25 03:32:01 +09: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
Erik Demaine
cbd3afd738 Fix \not vertical alignment (#1497)
* Fix \not vertical alignment

Fix #1491 by changing from `position: absolute` to `position: relative`.

* Switch to \rlap implementation of \not

* Separate \not the macro from \not the symbol via \@not

* Fix test
2018-07-24 02:01:02 +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
Ron Kok
b43ed4b645 Support \pmb (#1418)
* Support \pmb

* Fix lint error

* Add phony screenshots

* Screenshots take two

* Screenshots take three

* Simplify copies

* Move determination of mclass from handler to htmlBuilder

* Change to a macro definition

* Update screenshots

* Pick up review comments

* Clean up nesting of braces

* Update screenshot
2018-07-22 17:46:12 -04:00
Erik Demaine
74fb394bb5 Update fonts to remove \neq and \notin glyphs (#1499)
See https://github.com/KaTeX/katex-fonts/pull/53
2018-07-23 01:58:21 +09: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
71035c7111 Refactor test helpers (#1336)
* Refactor test helpers

* Combine common codes from `parse` and `build`, and dispatch using
`Mode`
* Remove `toNotBuild` and `toNotParse` and use `expect.not`
* Remove `Warning` and instead mock `console.warn`
* Add `expect.toHavePassed` and check whether parse/build succeeded
lazily
* Improve failed test `message`:
  - Use color
  - Print stack traces(excluding internals)
  - Print diff
  - Follow jest matcher output style

* Update helpers.js

* Remove toBeTruthy checks

getParsed throws an error if parsing fails.

* Used tagged literals

* Use .toHaveLength

* Use tagged literals

* Use to{Build,Parse}Like where possible

* Remove compareParseTree

* Use snapshot where possible

* Join into one line where <88 chars

* Revert console.warn() to throw an error

Merge `expectToWarn` to `expectKaTeX`, like
`expect.toFailWithParseError`

* Remove call to console.warn from stack traces

* Fix merge errors

* Remove `getTree`

* Move `_getBuilt` into `getBuilt`
* Move default settings and tagging literal support in to `getParsed` 
and `getBuilt`
* Remove stack traces clean-up
* Remove `toHavePassed` matcher

* Extract `expected` string construction into `printExpectedResult`
2018-07-21 19:06:07 -07:00
ylemkimon
c9947220b6 Remove codes that require expensive polyfill (#1469)
* Revert "Cleanup domTree.js to re-use code (#1305)"

This reverts commit 9bb48b83f1.

* Cleanup domTree.js to re-use code

* Extract common constructor/methods into functions

* Remove for...of

* Added eslint rule to disallow for...of

* Remove array destructuring

* Added eslint rule to disallow array destructuring

* Add eslint rule to disallow class inheritance

* Remove Object.keys and Object.assign

* Do not polyfill Object.freeze

* Babel: enable loose mode

* Undo disabling `linebreak-style`

* Move `children` initialization out of `initNode`

* Blacklist files for `no-restricted-syntax`

* Revert "Remove array destructuring"

This reverts commit c9d52c2db31c68cca77fea6ad774ee58b0632ff3.
2018-07-21 18:57:07 -07:00
Kevin Barabash
8eed4e2795 update fonts to use \not character without left side-bearing correction, fixes #1189 (#1267)
* update fonts to use \not character without left side-bearing correction, fixes #1189

* update katex-fonts submodule

* update katex-fonts submodule

* add comment

* Update fonts submodule

* Update screenshots
2018-07-22 04:17:07 +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
Ashish Myles
7150c2550d Port buildMathML to @flow. (#1486)
* Port buildMathML to @flow.

* Update code after sync. Address reviewer comments.
2018-07-18 23:04:41 +09:00
Erik Demaine
578877764d \@binrel command and refactor (#1487)
* \@binrel command and refactor

New `\@binrel{x}{y}` command renders `y` as if it's a bin/rel/ord like `x`.
This is equivalent to AMSTeX's `\binrel@{x}\binrel@@{y}`.
It will hopefully be useful for macros, such as `\pmb` (#1418).

Also refactor the (already duplicated) code for implementing this
functionality into buildCommon.binrelClass.

* Add tests; fix flow error

* Another test

* Move binrelClass to functions/mclass.js

* Remove expensive array destructuring polyfill
2018-07-17 19:49:50 -07:00
Ron Kok
8f5239c272 Fix \operatorname (#1461)
* Fix operatorname

* Update MathML

* Update screenshots

* Fix lint error

* Pick up comment

* Remove duplicate lines

* Fix lint error

* Remove duplicate code

* Replace \pi with \Pi in test

* Revise RegEx

* Update RegEx
2018-07-17 02:08:41 +09:00
Ashish Myles
f0976ade26 Refactor documentFragment and implement both HtmlDomNode and MathDomNode interfaces (stepping stone to port buildMathML to flow) (#1478)
* Make MathNodeClass include documentFragment for ergonomics.

* Separate out the HTML and MathML documentFragments.

These two documentFragments have different additional properties/methodsi
and limitations. This separation is needed for porting buildMathML to
flow.

* Coalesce the documentFragment subclasses to avoid subclassing polyfill.

* Make DomSpan and SvgSpan type aliases again instead of subclasses.

* Remove type MathNodeClass in favor of MathDomNode.

* Resolve $FlowFixMes by reordering variants of a union type.
2018-07-16 15:41:27 +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
9783ac1466 Make unicodeAccents.js ES6 module (#1477)
Use `babel-register` in `unicodeMake.js` to require ES6 module.
2018-07-15 13:54:54 -04:00
Erik Demaine
b7277049a4 \char character escaping and nicer MathML via \html@mathml (#1454)
* \html@mathml

Fix #1452

* Add missing file

* Implement \char (via internal \@char)

* Remove excess <mstyle> wrapper on \mathbin etc.

* Fix tests

* Add Unicode support for \copyright and \textregistered

Testing that this doesn't lead to an infinite loop thanks to \char` escaping.

* Add tests

* Use assertNodeType

* Switch from regex to lookup table, and no parseInt
2018-07-14 08:36:23 -04:00
Erik Demaine
33ef4bdc63 AsciiMath: link to asciimath2tex (#1474) 2018-07-13 14:19:59 +09:00
ylemkimon
747a98555d Remove tree cloning before building HTML (#1470)
* Reset `supSub.value.base` after building `supSubGroup`

* Remove tree cloning before building HTML

`buildExpression` is no longer destructive, added comment regarding it,
2018-07-12 00:28:56 +09:00
ylemkimon
35aece7763 Set documentFragment.style to empty object (#1471)
Remove `style` getter and setter in `documentFragment`
2018-07-11 11:09:42 -04:00
Ron Kok
db585fae54 Support \genfrac and \above (#1458)
* Support \genfrac and \above

* Accommodate delimiters inside groups

* Update screenshots take one`

* Update screenshots take two

* Fix flow error

* Fix lint error
2018-07-07 17:01:37 -07: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
Ron Kok
f3c167c601 Support Unicode corners (#1459)
* Support Unicode corners

* Fix \lrcorner
2018-07-02 07:53:29 +09:00
Ron Kok
c599c613f0 Refactor genfrac.js (#1455) 2018-06-29 03:09:59 +09:00
ylemkimon
a8015d0feb Allow only allowed protocols in \href (#1440)
* Allow only allowed protocols in \href

Added `allowedProtocols` settings

* Fix a typo

* Allow boolean argument

* Allow wildcard(*) argument

Revert 'Allow boolean argument'
2018-06-27 19:51:12 -04:00
Ron Kok
8621f5b76a Support \brace and \brack (#1453)
* Support \brace and \brack

* Update screenshots
2018-06-28 03:43:02 +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
Ron Kok
12dcb05209 Fix arrowheads for mhchem <--> (#1451)
* Fix arrowheads for mhchem <-->

* Update screenshots
2018-06-27 02:02:11 +09:00
Ryan Randall
062f8fbdbd Phantom text (#1449)
* Enabling phantom in text mode.

* Adding screenshots.
2018-06-26 17:50:20 +09:00
Ryan Randall
f7880acb02 Expose dom tree (#1446)
* Exposes domTree

* Exposing domTree

* Update per comment.
2018-06-25 15:47:23 -04: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
Ron Kok
3e932b1ecb Support \oiint and \oiiint (#1430)
* Support \oiint and \oiiint

* Fix sub. Add tests

* Add phony screenshots

* Add real screenshots
2018-06-19 09:41:00 -04: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
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
Erik Demaine
4a2903148e Automatic mrel/mbin spacing for \boldsymbol (#1388)
* Automatic mrel/mbin spacing for \boldsymbol

Fix #1154

* Add test

* Add missing mode

* Separate out \boldsymbol support to correct flow types

* Fix ternaries thanks to @ronkok's comment

* Revert package-lock.json

* Add screenshot test
2018-06-11 08:19:50 -04:00
Ron Kok
954ddf4172 Edit \lbrack and \rbrack (#1420) 2018-06-10 12:43:23 -04:00