Hi everyone,
This is my first post here. I am new to logseq and as a compulsive note-taker I think logseq is the closest thing to perfection I could have hoped for, I am loving it so far. Thank you all for building it.
To make it more useful to myself I would like to be able to import notes from my ebook reader. But unfortunately I haven’t found a plugin that supports my specific brand of ebook reader. I have annotations and highlights for over a decade now, hundreds of books and thousands of highlights, these are important to me and would like to use logseq to cross-reference them.
I have started writing my own plugin to do the import and I am struggling a bit with the plugin development workflow in typescript. At the moment I develop in a text editor, build the rolled-up plugin with yarn
and then close logseq, reopen logseq to force a reload of the latest build of the plugin from the “unpacked” folder. This multistep process is a bit cumbersome when you are learning and still feeling your way around with the API. Is there a better way? Maybe a live reload functionality?
Another related question, is it possible to “live code” using the plugin API in the logseq browser console. I have tried opening the console to create a page, but the API in the console looks nothing like the plugin API in the documentation, so I am a bit confused, are plugins executed in a separate environment? could I build my importer in a more “live” workflow?
For example if I open logseq’s browser console, I can type:
logseq.api.create_page("Book title")
And shazam! A page appears. Great. But using the same call in the plugin doesn’t seem to work. In the plugin API, page creation takes this call:
logseq.Editor.createPage("Book title")
Any tips that could help me get up to speed on plugin development would be most welcome. Thank you in advance.