|
|
|
|
@ -1,13 +1,15 @@
|
|
|
|
|
import type { Editor } from 'ckeditor5';
|
|
|
|
|
import type { SlashCommandEditorConfig } from 'ckeditor5-premium-features';
|
|
|
|
|
import { icons as admonitionIcons } from '@triliumnext/ckeditor5-admonition';
|
|
|
|
|
import { icons as footnoteIcons } from '@triliumnext/ckeditor5-footnotes';
|
|
|
|
|
import { ADMONITION_TYPES, type AdmonitionType } from '@triliumnext/ckeditor5-admonition';
|
|
|
|
|
|
|
|
|
|
type SlashCommandDefinition = SlashCommandEditorConfig["extraCommands"][number];
|
|
|
|
|
|
|
|
|
|
export default function buildExtraCommands(): SlashCommandDefinition[] {
|
|
|
|
|
return [
|
|
|
|
|
...buildAdmonitionExtraCommands()
|
|
|
|
|
...buildAdmonitionExtraCommands(),
|
|
|
|
|
...buildFootnoteExtraCommands()
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -23,3 +25,15 @@ function buildAdmonitionExtraCommands(): SlashCommandDefinition[] {
|
|
|
|
|
}
|
|
|
|
|
return commands;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function buildFootnoteExtraCommands(): SlashCommandDefinition[] {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
id: 'footnote',
|
|
|
|
|
title: 'Footnote',
|
|
|
|
|
description: 'Create a new footnote and reference it here',
|
|
|
|
|
icon: footnoteIcons.insertFootnoteIcon,
|
|
|
|
|
execute: (editor: Editor) => editor.execute("InsertFootnote")
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|