feat(slash): insert math

This commit is contained in:
Elian Doran 2025-06-16 20:55:02 +03:00
parent 13afcb8a49
commit c09a9aa7d3
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View File

@ -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 = {

View File

@ -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()
}
];
}