cortex-cms / cortex

:pencil: A headless, multitenant dynamic content platform powered by Rails, GraphQL and Elasticsearch
https://docs.cortexcms.org/
Apache License 2.0
32 stars 6 forks source link

WYSIWYG Widget System Refactor #565

Open toastercup opened 6 years ago

toastercup commented 6 years ago

While our current WYSIWYG Widget system isn't terrible, it also:

I'd suggest we move toward a standard such as Mobiledoc, which stores the rich text from the WYSIWYG as structured JSON data, rather than HTML, Markdown, etc. This allows us to deliver just the raw data to the client without any assumptions about how they'll be rendering it, with what framework they'll be using, etc. They're free to make their own rendering decisions, and they (and Cortex itself - i.e. for data integrity purposes) can easily manipulate anything within the structure of the Mobiledoc. This will also allow us to index and search/filter on this data, as it will play nicely with JSONB and ElasticSearch.

Additionally, Mobiledoc has its own concept of Widgets called 'Cards' (a less ambiguous name, frankly), which gives us a wonderful platform to start from, and a large community of pre-existing Card content to integrate with Cortex.

Ghost 2.0 utilizes Mobiledoc/Cards to great effect: https://blog.ghost.org/2-0/