aidenlx / marginnote-companion

An Obsidian plugin to bridge MarginNote 3 and Obsidian.md
MIT License
153 stars 14 forks source link

Mobile support #3

Closed tklosek0 closed 2 years ago

tklosek0 commented 2 years ago

Hello,

i would like to try this plugin but it seems it does not work on iPad? It wont let me activate this plugin in the plugin view.

aidenlx commented 2 years ago

Yes, it is intentional since I haven't figure a way to inject handlers to paste events on mobile (CodeMirror 6).

tklosek0 commented 2 years ago

Okay, will this be a long-term issue? Since i do not use MacOS but just an iPad for me it wouldnt work.

aidenlx commented 2 years ago

Yes, it may take a while. Since paste events in the editor are not exposed to API in obsidian yet, I have to access codemirror directly, which varies significantly between mobile and desktop. Mobile and future WYSIWYG mode use CodeMirror 6, which is known to be more difficult to understand and inject into. I have thought about using the context menu in the editor as a workaround, but it seems to be only exposed to internal links on mobile. If you are okay with using a command every time you insert, it is doable but quite annoying to use, which is not what I'm intended to achieve.

tklosek0 commented 2 years ago

Thanks for the answer! I can understand if that is not user-friendly or workflow-enhancing but it would be a solid start to simply use the plugin. By now there is no way for iPad users to gain out of your plugin :)

aidenlx commented 2 years ago

Now with v5.0.1, you can add commands "Insert MarginNote Data to Active Note" and "Auto Insert MarginNote Data to Active Note" to the mobile toolbar, and assign hotkeys to it if you are using a keyboard.

tklosek0 commented 2 years ago

Thanks! Can you please share a little example how to use it? Im focusing an Note in MarginNote and activated the Bridge-Symbol and did "Insert MarginNote Data to Active Note" in an Obsidian-Note but nothing happens.

aidenlx commented 2 years ago

You need to select the note after obsidian-bridge is active, then use command to insert

https://user-images.githubusercontent.com/31102694/133299092-1318676b-f799-4af8-bdb0-2b6099a0eb98.mp4

(the question mark icon at the toolbar is the shortcut for newly added command, and you can also assign swipe from top to "Insert MarginNote Data to Active Note" to paste data in

tklosek0 commented 2 years ago

Ok, with "Auto Insert MarginNote Data to Active Note" it seems to work! Thanks!