Skip to content

Commit

Permalink
[skip ci] Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
3846masa committed Jul 21, 2019
1 parent 7a6193e commit b509302
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,30 @@
[npm]: https://www.npmjs.com/package/@paperist/remark-math
[license]: https://3846masa.mit-license.org
[standard-readme]: https://github.com/RichardLitt/standard-readme

[npm-badge]: https://img.shields.io/npm/v/@paperist/remark-math.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURcwAAOeIiP////G7u/ri4tIZGdpFReJsbPC3t075sZwAAAAvSURBVCjPY2CgDWAThIMEsACjEhwIUCZg0dGCIqASwMAxMgXAgSzOwMAOC2TqAwBvzR4JxLaP0gAAAABJRU5ErkJggg==
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA%2BgAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAVUExURSBTICJcIiNgIiZoJTuhNyt3Kf///%2BCqxSgAAAAGdFJOUwpclbn%2B4Fj6/H8AAAABYktHRAZhZrh9AAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4AkEEjEV7MDQQwAAAGBJREFUCNc1TUEKgDAMi07vE/Q%2BRD8g%2B4BbvAvi/79iMjDQJm1CC6BbDzRsZI3incIpYeYFhCaYnLiyPYnYkwWZFWoFHrSuttCmmbwXh0eJQYVON4JthZTxCzzAmyb8%2BAAKXBRyN6RyZQAAAABJRU5ErkJggg==
[standard-readme-badge]: https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square
[npm-badge]: https://flat.badgen.net/npm/v/@paperist/remark-math
[license-badge]: https://flat.badgen.net/badge/license/MIT/blue
[standard-readme-badge]: https://flat.badgen.net/badge/standard-readme/OK/green

> [wooorm/remark] plugin for math likes [KaTeX] / [MathJax]
[wooorm/remark]: https://github.com/wooorm/remark
[KaTeX]: https://khan.github.io/KaTeX/
[MathJax]: https://www.mathjax.org/
[katex]: https://khan.github.io/KaTeX/
[mathjax]: https://www.mathjax.org/

## Table of Contents

<!-- TOC depthFrom:2 depthTo:3 updateOnSave:false -->

- [Install](#install)
- [Usage](#usage)
- [AST](#ast)
- [`Math`](#math)
- [`InlineMath`](#inlinemath)
- [Contribute](#contribute)
- [License](#license)

<!-- /TOC -->

## Install

```
Expand All @@ -51,10 +56,12 @@ radius \\(r\\) is the set of all points \\((x, y)\\) such that
> https://en.wikipedia.org/wiki/Circle
`;

const processor = unified().use(parser).use(math);
const processor = unified()
.use(parser)
.use(math);
const ast = processor.parse(markdown);

processor.run(ast).then(ast => {
processor.run(ast).then((ast) => {
console.dir(ast, { depth: null });
});
```
Expand All @@ -68,10 +75,10 @@ See also [mdast], [unist].

### `Math`

`Math` extends [`Text`][unist-text].
`Math` extends [`Literal`][unist-literal].

```typescript
interface Math extends Text {
interface Math extends Literal {
type: 'math';
math: string;
}
Expand All @@ -97,10 +104,10 @@ Yields:

### `InlineMath`

`InlineMath` extends [`Text`][unist-text].
`InlineMath` extends [`Literal`][unist-literal].

```typescript
interface InlineMath extends Text {
interface InlineMath extends Literal {
type: 'inlineMath';
math: string;
}
Expand All @@ -122,14 +129,12 @@ Yields:
}
```

[unist-text]: https://github.com/syntax-tree/unist#text
[unist-literal]: https://github.com/syntax-tree/unist#literal

## Contribute

PRs accepted.

## License

![3846masa] MIT (c) 3846masa

[3846masa]: https://www.gravatar.com/avatar/cfeae69aae4f4fc102960f01d35d2d86?s=50
[MIT (c) 3846masa](https://3846masa.mit-license.org)

0 comments on commit b509302

Please sign in to comment.