editorjs-math
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "editorjs-math", | ||
"version": "1.0.1", | ||
"description": "Math Block for Editor.js (allow Tex syntax)", | ||
"version": "1.0.2", | ||
"description": "Math Block for Editor.js", | ||
"main": "./dist/bundle.js", | ||
@@ -32,3 +32,6 @@ "scripts": { | ||
"style-loader": "^1.2.1" | ||
}, | ||
"dependencies": { | ||
"katex": "^0.13.0" | ||
} | ||
} |
![](https://badgen.net/badge/Editor.js/v2.0/blue) | ||
# Math Tool for Editor.js | ||
This is a plugin for Editor.js. To use this package, you need to install [editorjs](https://www.npmjs.com/package/@editorjs/editorjs) first | ||
![image](https://user-images.githubusercontent.com/51183663/86523997-4c787500-bea7-11ea-8f96-36b96d6ff96d.png) | ||
Transform Tex syntax/plain text to pretty math equations | ||
Based on mathJax and mathjs | ||
Transform laTex text to pretty math equations | ||
![image](https://user-images.githubusercontent.com/51183663/84605226-486fbd80-aece-11ea-9bc0-38c90cd8bc05.png) | ||
Demo: https://flaming-cl.github.io/editorPlugin | ||
This is a plugin for Editor.js. To use this package, you need to install [editorjs](https://www.npmjs.com/package/@editorjs/editorjs) first | ||
Here are the supported functions: https://katex.org/docs/supported.html | ||
### Install via NPM | ||
Get the package | ||
```shell | ||
npm i --save-dev editorjs-math | ||
``` | ||
Include module at your application | ||
```javascript | ||
const mathTex = require('editorjs-math'); | ||
// or import MathTex from 'editorjs-math'; | ||
``` | ||
### Load from CDN | ||
```javascript | ||
<script src="https://cdn.jsdelivr.net/npm/editorjs-math@1.0.2/dist/bundle.js"></script> | ||
``` | ||
## Usage | ||
@@ -21,4 +42,4 @@ | ||
... | ||
Math: { | ||
class: Math, | ||
math: { | ||
class: MathTex, // for CDN: window.MathTex | ||
}, | ||
@@ -41,11 +62,12 @@ } | ||
```json | ||
Text can be plain text or Tex syntax($ can be omitted) | ||
{ | ||
"type" : "math", | ||
"data" : { | ||
"text" : "sqrt(9 / 3) - cos(pi / 4)^2", | ||
{ | ||
"type" : "math", | ||
"data" : { | ||
"text" : "\\{1,2,3,\\ldots ,n\\}", | ||
} | ||
} | ||
} | ||
``` | ||
## Credits | ||
Katex: https://github.com/KaTeX/KaTeX |
Sorry, the diff of this file is too big to display
1627264
64
26
72
1
+ Addedkatex@^0.13.0
+ Addedcommander@8.3.0(transitive)
+ Addedkatex@0.13.24(transitive)