decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.94k stars 3.04k forks source link

WYSIWYG editor that outputs HTML instead of Markdown #4419

Open blairanderson opened 4 years ago

blairanderson commented 4 years ago

Is your feature request related to a problem? Please describe.

it is common for jekyll (and other static generator) sites to use html as body format instead of markdown.

markdowhtml

I would like to configure the body widget to use an HTML WYSIWYG editor, instead of a markdown WYSIWYG. Where the content outputs are HTML.

I have this on a couple sites, for many different reasons. I will have a collection that uses HTML instead of Markdown as the content. Mostly when a page needs more customization than working in markdown. very similar to the standard Wordpress editor.

Describe the solution you'd like

Would like a widget configuration type of html that embeds a WYSIWYG editor with html output. I would use this in place of the markdown widget

Describe alternatives you've considered

<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<script src="https://unpkg.com/netlify-cms-widget-richtext"></script>
<script>
  CMS.registerWidget('richtext', RichTextControl, RichTextPreview)
</script>
mdejuan commented 3 years ago

Is your feature request related to a problem? Please describe.

it is common for jekyll (and other static generator) sites to use html as body format instead of markdown.

markdowhtml

I would like to configure the body widget to use an HTML WYSIWYG editor, instead of a markdown WYSIWYG. Where the content outputs are HTML.

I have this on a couple sites, for many different reasons. I will have a collection that uses HTML instead of Markdown as the content. Mostly when a page needs more customization than working in markdown. very similar to the standard Wordpress editor.

Describe the solution you'd like

Would like a widget configuration type of html that embeds a WYSIWYG editor with html output. I would use this in place of the markdown widget

Describe alternatives you've considered

https://jpuri.github.io/react-draft-wysiwyg/#/demo

I understand the hardest part would be the editor blocks. but these could be iterated over time after the WYSIWYG goes through beta

Hi @blairanderson did you find any solution for this?

blairanderson commented 3 years ago

@mdejuan no I didn't. I would like to use react-draft wysiwyg but have not attempted to implement a custom editor.

mdejuan commented 3 years ago

Thanks @blairanderson

FSaldanha commented 3 years ago

@blairanderson Your ideia was really good so I tried to implement it. Check the package netlify-cms-widget-richtext at npm. In the final version I used react-rte, but there is a branch on repo in which I used react-draft-wysiywg. (Related: #4062)