mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	feat(slash): insert math
This commit is contained in:
		
							parent
							
								
									13afcb8a49
								
							
						
					
					
						commit
						c09a9aa7d3
					
				| @ -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 = { | ||||
|  | ||||
| @ -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() | ||||
|         } | ||||
|     ]; | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran