An open API service indexing awesome lists of open source software.

https://github.com/flydev-fr/editorjs-maths

Math plugin for editor.js
https://github.com/flydev-fr/editorjs-maths

Last synced: 5 months ago
JSON representation

Math plugin for editor.js

Awesome Lists containing this project

README

          

# Math Tool for Editor.js

Math Tool for the [Editor.js](https://ifmo.su/editor) allows to include math in your articles.
You can see it in action [here](https://sorenholsthansen.github.io/editorjs-maths-example/).

## Install

Download the package through npm (or yarn)

```
npm i --save-dev editorjs-maths
yarn add editorjs-maths
```

and include the package in your app

```javascript
const MathTool = require('editorjs-maths');
// or import MathTool from 'editorjs-maths';
```

You can also load it from CDN

```html

```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
...

tools: {
...
math: MathTool,
}

...
});
```

## Config Params

| Field | Type | Description |
| ----------- | -------- | ------------------------------ |
| placeholder | `string` | Code Tool's placeholder string |

## Output data

This Tool returns math.

```json
{
"type": "code",
"data": {
"tex": "x^2"
}
}
```

## KaTeX

This tool is build on top of [KaTeX](https://katex.org/).