-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
93 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
"Daniel Perez Alvarez <[email protected]>", | ||
"TANIGUCHI Masaya <[email protected]>" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"dtslint": "^3.6.12", | ||
"lerna": "^3.0.0", | ||
|
@@ -39,8 +38,12 @@ | |
"format": "remark . -qfo && prettier . --write && xo --fix", | ||
"test-api": "tape \"packages/*/test.js\" \"packages/*/test/**/*.js\"", | ||
"test-coverage": "nyc --reporter lcov tape \"packages/*/test.js\" \"packages/*/test/**/*.js\"", | ||
"test-types": "dtslint packages/rehype-katex/types && dtslint packages/rehype-mathjax && dtslint packages/remark-html-katex/types && dtslint packages/remark-math/types", | ||
"test": "run-s format test-types test-coverage" | ||
"test:types": "run-p test:types:rehype-katex test:types:rehype-mathjax test:types:remark-html-katex test:types:remark-math", | ||
"test:types:rehype-katex": "dtslint packages/rehype-katex/types", | ||
"test:types:rehype-mathjax": "dtslint packages/rehype-mathjax", | ||
"test:types:remark-html-katex": "dtslint packages/remark-html-katex/types", | ||
"test:types:remark-math": "dtslint packages/remark-math/types", | ||
"test": "run-s format test:types test-coverage" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import unified from 'unified' | ||
import katex from 'rehype-katex' | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(katex) | ||
// $ExpectType Processor<Settings> | ||
unified().use(katex, {output: 'html'}) | ||
// $ExpectError | ||
unified().use(katex, {invalidProp: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Minimum TypeScript Version: 3.2 | ||
import {Plugin} from 'unified' | ||
|
||
// Should be ported back to MathJax repo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import unified from 'unified' | ||
import mathjax from 'rehype-mathjax' | ||
import chtml from 'rehype-mathjax/chtml' | ||
import browser from 'rehype-mathjax/browser' | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(mathjax) | ||
// $ExpectType Processor<Settings> | ||
unified().use(mathjax, {minScale: 3}) | ||
// $ExpectError | ||
unified().use(mathjax, {invalidProp: true}) | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(chtml, {fontURL: 'url'}) | ||
// $ExpectError | ||
unified().use(chtml) | ||
// $ExpectError | ||
unified().use(chtml, {}) | ||
// $ExpectError | ||
unified().use(chtml, {adaptiveCSS: true}) | ||
// $ExpectError | ||
unified().use(chtml, {fontURL: 'url', invalidProp: true}) | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(browser) | ||
// $ExpectType Processor<Settings> | ||
unified().use(browser, {displayMath: ['$$', '$$']}) | ||
// $ExpectType Processor<Settings> | ||
unified().use(browser, { | ||
displayMath: [ | ||
['$$', '$$'], | ||
['((', '))'] | ||
] | ||
}) | ||
// $ExpectError | ||
unified().use(browser, {displayMath: ['$$']}) | ||
// $ExpectError | ||
unified().use(browser, {invalidProp: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import unified from 'unified' | ||
import html from 'remark-html-katex' | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(html) | ||
// $ExpectType Processor<Settings> | ||
unified().use(html, {output: 'mathml'}) | ||
// $ExpectError | ||
unified().use(html, {output: true}) | ||
// $ExpectError | ||
unified().use(html, {invalidProp: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import unified from 'unified' | ||
import math from 'remark-math' | ||
|
||
// $ExpectType Processor<Settings> | ||
unified().use(math) | ||
// $ExpectType Processor<Settings> | ||
unified().use(math, {inlineMathDouble: true}) | ||
// $ExpectError | ||
unified().use(math, {inlineMathDouble: 3}) | ||
// $ExpectError | ||
unified().use(math, {invalidProp: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters