cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

[Feature request] Document methods and events

Open ivanjaros opened this issue 2 years ago • 4 comments

There seems to be no documentation for events or methods. Without them this is unfortunately unusable.

ivanjaros avatar Sep 02 '23 18:09 ivanjaros

Api example Does this satisfy you? In the future, we will update a brand new document.

RSS1102 avatar Sep 02 '23 18:09 RSS1102

Somehow. But it is missing list of events I can listen for and how to listen to them(i am trying to embed this into vue component). Also I am not seeing how to bind the editor to a html element. I thought I would just use html id as "id" for the instance but when i run it the editor is not contained within that element at all so it seems the editor does not respect this and appends itself to the html document instead.

ivanjaros avatar Sep 02 '23 18:09 ivanjaros

I personally believe that :

  1. when embedded in Vue, you should correspond to the declaration cycle of new Cherry.
let cherryMarkdown;
onMounted(() => {
  cherryMarkdown = new Cherry(defaultConfig);
})

2.When you want to trigger the acquisition of their data:

cherryMarkdown.getMarkdown()
cherryMarkdown.getHtml()

as the API name suggests.

hoped can help you.

RSS1102 avatar Sep 02 '23 18:09 RSS1102

Thanks. I have decided to write my own implementation in the end. I will keep this open since I think the documentation needs to be updated.

ivanjaros avatar Sep 03 '23 06:09 ivanjaros