Skip to content

Commit 21b8e7a

Browse files
committed
feat: add ai assiant menu button
1 parent a47fea3 commit 21b8e7a

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/index.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import { DefaultTemplatesConfig } from "./settings/defaultTemplatesConfig";
1616
import { CommandsPanel } from "./views/commandsPanel";
1717

1818
const DOCUMENTATION_URL = "https://github.com/joplin/plugin-templates#readme";
19+
const AI_ASSISTANT_URL = "https://joplin-templates-assistant.nishantwrp.com/";
1920

2021
joplin.plugins.register({
21-
onStart: async function() {
22+
onStart: async function () {
2223
// Register setting section
2324
await PluginSettingsRegistry.registerSettings();
2425

@@ -242,6 +243,14 @@ joplin.plugins.register({
242243
}
243244
}));
244245

246+
joplinCommands.add(joplin.commands.register({
247+
name: "showAIAssistant",
248+
label: "AI Assistant",
249+
execute: async () => {
250+
await joplin.commands.execute("openItem", AI_ASSISTANT_URL);
251+
}
252+
}));
253+
245254
joplinCommands.add(joplin.commands.register({
246255
name: "showPluginDocumentation",
247256
label: "Help",
@@ -304,6 +313,9 @@ joplin.plugins.register({
304313
},
305314
]
306315
},
316+
{
317+
commandName: "showAIAssistant"
318+
},
307319
{
308320
commandName: "showPluginDocumentation"
309321
}
@@ -352,6 +364,10 @@ joplin.plugins.register({
352364
label: "Clear default templates for notebook",
353365
command: "clearDefaultTemplatesForNotebook"
354366
},
367+
{
368+
label: "AI Assistant",
369+
command: "showAIAssistant"
370+
},
355371
{
356372
label: "Help",
357373
command: "showPluginDocumentation"

0 commit comments

Comments
 (0)