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
- Host: GitHub
- URL: https://github.com/flydev-fr/editorjs-maths
- Owner: flydev-fr
- License: mit
- Created: 2021-06-10T07:13:23.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-24T09:34:53.000Z (about 5 years ago)
- Last Synced: 2025-10-25T16:52:47.202Z (8 months ago)
- Size: 83 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/).