MathType Web Integrations → Documentation
Mono-repository for the MathType Web plugins and their dependencies.
To capture events triggered by MathType editor, use the next code:
// Capture onModalOpen event triggered when MT/CT editor is open
let modalOpenListener = window.WirisPlugin.Listeners.newListener('onModalOpen', () => {
... // Your callback function
});
window.WirisPlugin.Core.addGlobalListener(modalOpenListener);
onModalOpen()
Triggered when MT/CT editor modal is openonModalClose()
Triggered when MT/CT editor modal is close
Using this project requires having git, Nx and yarn installed:
- Follow this guide to install yarn.
- Follow this guide to install git.
- Run the following command, in your project directory, to install Nx:
yarn global add nx
.
This project runs shell commands not compatible among different OS.
To prevent that, you need to run the commands in the git bash
instead of the windows one.
This repository has a monorepo structure. This means that the source code of multiple npm packages is stored in a single git repository. Some of these packages depend on each other, so storing them together allows for a faster development cycle. In order to manage multiple packages, we use Nx as a cornerstone of the project structure.
The main functionality of Nx is bootstrapping. Bootstrapping consists of linking to the local source code of the dependencies instead of downloading them from npm. This allows us to make live changes to some dependency and see how it affects another package without having to publish the dependency to npm.
The most important files and folders are:
docs
. The main documentation for the project. You can see the stable version rendered here.packages
. The source code of the plugins, as well as their common API known as the "devkit". Each folder contains one npm package. All the usual npm commands work inside.demos
. A growing set of demos to help developers integrate these plugins on different scenarios.scripts
. Scripts used for different development tasks.resources
. Resources files that are needed for the publish workflow.
You can clone this repo as follows:
$ git clone https://github.com/wiris/html-integrations
After cloning the repo, run the following command on the project root:
$ yarn
This will bootstrap the packages using Yarn
and Nx
.