@ctoweb/plugin-math
v3.5.3
Published
Math(数学公式)
Readme
@ctoweb/plugin-math
数学公式
安装
$ yarn add @ctoweb/plugin-math添加到引擎
import Engine, { EngineInterface } from '@ctoweb/engine';
import Math , { MathComponent } from '@ctoweb/plugin-math';
new Engine(...,{ plugins:[ Math ] , cards:[ MathComponent ]})Math 可选项
//使用配置
new Engine(...,{
config:{
[Math.pluginName]:{
//...相关配置
}
}
})请求生成公式代码为图片或 SVG
mathRequestUrl: 请求地址,始终使用 GET 请求
/**
* 请求生成公式svg地址
*/
mathRequestUrl: string; //使用math-api搭建的自己的公式服务,生成公式的一个网络连接,不配置的情况下默认生成base64图片 该配置影响最终文章的大小
/**
命令
插入公式代码
参数 1:公式代码
参数 2:公式对应图片地址或SVG代码
engine.command.execute(
Math.pluginName,
'公式代码', //可选
'公式对应图片地址或`SVG`代码', //可选
);