christophebe / strapi-julius-editor

3 stars 2 forks source link

[BUG] Improve documentation #2

Closed SalahAdDin closed 3 months ago

SalahAdDin commented 4 months ago

Right now, checking the code source, it is not clear what a BLOC content is and its purpose, and, whether the editor's output is either HTML or JSON; being the JSON a better option for parsing.

How can we improve this?

christophebe commented 4 months ago

Hi,

Bloc content can be used to add structured content/data in a text, for example, a call to action. It is based on the Tiptap interactive node views : https://tiptap.dev/docs/editor/guide/node-views/react

the output is a tag :

<bloc-component 
type\"..." 
title="...." 
text="..."
link_text="..."
link_url="....">
</bloc-component>

Currently there is only one type content bloc with the following attributes : type, title, text & link. It should be nice add other type.

In your front-end, eg. NextJS, you can use a lib like html-react-parser to render this kind of tag

SalahAdDin commented 4 months ago

Hi,

Bloc content can be used to add structured content/data in a text, for example, a call to action. It is based on the Tiptap interactive node views : https://tiptap.dev/docs/editor/guide/node-views/react

the output is a tag :

<bloc-component 
type\"..." 
title="...." 
text="..."
link_text="..."
link_url="....">
</bloc-component>

Currently there is only one type content bloc with the following attributes : type, title, text & link. It should be nice add other type.

In your front-end, eg. NextJS, you can use a lib like html-react-parser to render this kind of tag

Is it BLOC or Block?

christophebe commented 3 months ago

Indeed, it should better to use block I will fix it !

christophebe commented 3 months ago

fixed in v 0.0.8. Now it is "block-component"