Skip to content

Build your personal knowledge base with Trilium Notes

feat(todo): add /todo command

Jakob Schlanstedt023eefe687da
diff --git a/apps/client/src/widgets/type_widgets/text/config.ts b/apps/client/src/widgets/type_widgets/text/config.ts
index b5fcbd6293..3fe98b2389 100644
--- a/apps/client/src/widgets/type_widgets/text/config.ts
+++ b/apps/client/src/widgets/type_widgets/text/config.ts
@@ -194,7 +194,7 @@ export async function buildConfig(opts: BuildEditorOptions): Promise<EditorConfi
// Drop CKEditor's built-in slash commands whose title/icon the palette re-defines: the
// Mermaid one (generic icon) and the list ones (Title Case titles, normalized to
// sentence case).
- removeCommands: ["insertMermaidCommand", "bulletedList", "numberedList", "todoList"],
+ removeCommands: ["insertMermaidCommand", "bulletedList", "numberedList"],
dropdownLimit: Number.MAX_SAFE_INTEGER
},
snippets: {
diff --git a/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts b/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts
index 68ad48e821..9510fa7fc3 100644
--- a/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts
+++ b/packages/ckeditor5/src/plugins/mention/slash_commands.spec.ts
@@ -555,6 +555,11 @@ describe("buildTriliumSlashCommands", () => {
expect(executeSpy).toHaveBeenCalledWith("alignment", { value });
});
+ it("finds the to-do list by the word todo", () => {
+ expect(matchSlashCommands(buildTriliumSlashCommands(editor), "todo").map((entry) => entry.id))
+ .toContain("todoList");
+ });
+
it("finds the collapsible block under the names other editors give it", () => {
const definitions = buildTriliumSlashCommands(editor);
diff --git a/packages/ckeditor5/src/plugins/mention/slash_commands.ts b/packages/ckeditor5/src/plugins/mention/slash_commands.ts
index 23db5bb57f..ab737953b6 100644
--- a/packages/ckeditor5/src/plugins/mention/slash_commands.ts
+++ b/packages/ckeditor5/src/plugins/mention/slash_commands.ts
@@ -476,6 +476,7 @@ function buildListSlashCommands(editor: Editor): SlashCommandDefinition[] {
id: "todoList",
title: t("To-do list"),
description: t("Create a to-do list"),
+ aliases: [ "todo" ],
icon: IconTodoList,
commandName: "todoList"
}