decaporg / decap-cms

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

Syntax highlighting in Markdown (or HTML) editor #245

Open biilmann opened 7 years ago

biilmann commented 7 years ago

Right now our markdown widget has a visual and raw mode, but the raw mode is just a wrapper around a textarea.

We should integrate CodeMirror as the raw editor, so we can do syntax highlighting of markdown and HTML.

See @ohadpr's PR #203 for more context.

erquhart commented 7 years ago

Since we'll be moving to Slate soon, we can use the code highlighting example there, which uses Prism underneath: http://slatejs.org/#/code-highlighting.

erquhart commented 6 years ago

It'd be awesome to use this instead of prism: https://github.com/conorhastings/react-syntax-highlighter

No stylesheet to include, built for React.

Whatever we do here, it should not be included in the main bundle, needs to be provided as some kind of add-on.

andreasvirkus commented 6 years ago

Is there a rough timeline when Slate support could be expected? Would that also somehow benefit me if I'd like to edit a single json file in the editor without defining each field separately?

Best, andreas

erquhart commented 6 years ago

Two different things there, you still need to define fields. Editing an entire raw entry is an interesting concept, don't think I've heard of anyone requesting that before 🤔

But yeah, that's probably not something we would do right now. This ticket is about using a proper code-editing UI within the markdown widget when editing raw markdown for a single field.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.