Hooking into "Copy As" modal

Howdy!

I would love to write a plugin (or even submit a PR to logseq) to format a text in a way compatible with WordPress’ new block editor.

I imagine this being here:

However, I have some trouble navigating the documentation.

  • Is there a method to hook into that modal, or should I just add another item in the block right-click menu?
  • Is there a method to get the entire gragh of the descendants of the block, or do I have to write a custom query?
  • Is there a method exposed for Markdown-> HTML conversion or should I write my own?

I would appreciate pointers to API methods, since I seem to have quite a hassle navigating docs :confused:

It’s not possible to hook into this modal unless you want to manipulate the DOM directly which is not ideal. Having a separate right click option would be the best.

I’d recommend looking at the PDF export plugin’s code as I’ve parsed the entire contents of the page.

For the markdown to HTML conversion, you can import MLDOC, GitHub - logseq/mldoc: Another Emacs Org-mode and Markdown parser. which is Logseq’s parser. Or use another markdown parser like markdown-it.

Also on a separate note, I’m curious about what you mean by a hassle navigating the docs, could you give some specific emaples and points of improvements. I’m working on improving those atm.

1 Like

Thank you , these are very good pointers!

Also on a separate note, I’m curious about what you mean by a hassle navigating the docs, could you give some specific emaples and points of improvements. I’m working on improving those atm.

For the APIs, I was looking at
https://plugins-doc.logseq.com/
and

And very few methods seem to be described. The types and names are helpful, but apart from that its guesswork to figure out what they do.
Don’t get me wrong, I am HUGELY fond of the project and what you have built in such a short time is amazing.
But these particular API docs could use a little more description

Thank you @Aryan again for following up!

I found some time to finally put the plugin together and it’s exactly what I was searching for: