The development version of the Semantic Math Editor contains compiled code and typescript typings.
You can use the editor from typescript, javascript or even directly from HTML pages.
It can be installed via NPM:
npm i semantic-math-editor
All the public API is contained in the semantic-math-editor module.
There are three main factory methods:
In most cases you will only need the first one to create editor and bind it to the HTML DOM element.
The rest two allow to create editors without binding it to the DOM model. The editors created without the DOM models have limited functionality.
The createEditor functions returns MathEditor object.
You can use it to:
So the basic typescript snippet is:
import {createEditor,MathEditor} from "semantic-math-editor";
//Get or create HTML element (like div)
const element = document.getElementById('my-id');
const editor = createEditor(element);
It is important to include several things in the HTML head section. At least include Katex CSS and set charset to UTF-8
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css"
integrity="sha256-uT5rNa8r/qorzlARiO7fTBE7EWQiX/umLlXsq7zyQP8=" crossorigin="anonymous">
</head>
Please click semantic-math-editor link below to read its documentation.
Please note that the work on documentation is currently in progress.
In case of any question, ask us at business@softaria.com
Generated using TypeDoc