Vimwiki-styled (,hopefully) text to new note plugin

Hi,
After a bit of struggle, I was finally able to start writing my first plugin for Joplin.
It converts some highlighted text into a new note page.

Release 0.1 · PhilipChen886/joplin-text-to-new-note-plugin (github.com)

It heavily borrowed code from Ambrt's joplin-plugin-create-note-from-text,
except I can only write a simple version of it, and I tried to add it to the Right-Click context menu.
ambrt/joplin-plugin-create-note-from-text (github.com)

I admit I struggled to understand the code all over the place, and I wish the comments in the src/index.ts file can provide some help (and confidence) to fellow starters.

Any advice will be greatly appreciated.

1 Like

What editor do you use? Because with VSCode for example, if you move your mouse over any API call you'll get the documentation, often with links to examples.

I do use VSCode, and yes, on mouse hover it does provide some information, but it still takes me awhile to understand it.

One of the things that got me stuck big ways today is the "create new note" part of this plugin:
I kept thinking about using

joplin.commands.execute('newNote');

But it doesn't allow adding title.
It never occurred to me that

joplin.data.post()

can also create a new note.
It was until I looked at Ambrt's code when I realize that notes can be created that way.

Guess that's how I learn to code...lol