Skip to content

Commit a2378fb

Browse files
committed
add command
1 parent 772bbce commit a2378fb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

apps/obsidian/src/utils/registerCommands.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
3131
},
3232
});
3333

34+
plugin.addCommand({
35+
id: "create-discourse-node",
36+
name: "Create Discourse Node",
37+
editorCallback: (editor: Editor) => {
38+
new CreateNodeModal(plugin.app, {
39+
nodeTypes: plugin.settings.nodeTypes,
40+
plugin,
41+
onNodeCreate: async (nodeType, title) => {
42+
await createDiscourseNode({
43+
plugin,
44+
nodeType,
45+
text: title,
46+
editor,
47+
});
48+
},
49+
}).open();
50+
},
51+
});
52+
3453
plugin.addCommand({
3554
id: "toggle-discourse-context",
3655
name: "Toggle Discourse Context",

0 commit comments

Comments
 (0)