Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Latest commit

 

History

History
69 lines (51 loc) · 1.42 KB

README.md

File metadata and controls

69 lines (51 loc) · 1.42 KB

Math Tool for Editor.js

image

Transform laTex text to pretty math equations

Demo: https://flaming-cl.github.io/editorPlugin
This is a plugin for Editor.js. To use this package, you need to install editorjs first
Here are the supported functions: https://katex.org/docs/supported.html

Install via NPM

Get the package

npm i --save-dev editorjs-math

Load from CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle.js"></script>

Include the module in your application

const mathTex = require('editorjs-math');
// or import MathTex from 'editorjs-math';

Usage

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

var editor = EditorJS({
  ...
  
  tools: {
    ...
    math: {
      class: MathTex, // for CDN: window.MathTex
    },
  }
  
  ...
});

Config Params

This Tool has no config params

Output data

Field Type Description
text string Math text
  {
        "type" : "math",
        "data" : {
            "text" : "\\{1,2,3,\\ldots ,n\\}",
        }
    }

Credits

Katex: https://github.com/KaTeX/KaTeX