diff --git a/packages/ckeditor5-math/src/index.ts b/packages/ckeditor5-math/src/index.ts index 781f07432..f33a90620 100644 --- a/packages/ckeditor5-math/src/index.ts +++ b/packages/ckeditor5-math/src/index.ts @@ -3,6 +3,7 @@ import './augmentation.js'; import "../theme/mathform.css"; export { default as Math } from './math.js'; +export { default as MathUI } from './mathui.js'; export { default as AutoformatMath } from './autoformatmath.js'; export const icons = { diff --git a/packages/ckeditor5/src/extra_slash_commands.ts b/packages/ckeditor5/src/extra_slash_commands.ts index 4f941cad3..f9caf3d0d 100644 --- a/packages/ckeditor5/src/extra_slash_commands.ts +++ b/packages/ckeditor5/src/extra_slash_commands.ts @@ -7,6 +7,7 @@ import { COMMAND_NAME as INTERNAL_LINK_COMMAND } from './plugins/internallink'; import { ADMONITION_TYPES, type AdmonitionType } from '@triliumnext/ckeditor5-admonition'; import dateTimeIcon from './icons/date-time.svg?raw'; import internalLinkIcon from './icons/trilium.svg?raw'; +import { icons as mathIcons, MathUI } from '@triliumnext/ckeditor5-math'; type SlashCommandDefinition = SlashCommandEditorConfig["extraCommands"][number]; @@ -33,6 +34,13 @@ export default function buildExtraCommands(): SlashCommandDefinition[] { description: "Insert a link to another Trilium note", icon: internalLinkIcon, commandName: INTERNAL_LINK_COMMAND + }, + { + id: "math", + title: "Math equation", + description: "Insert a math equation", + icon: mathIcons.ckeditor, + execute: (editor: Editor) => editor.plugins.get(MathUI)._showUI() } ]; }