Change Composer to Redactor
-
The more thought I give to this (and the more time I spend with NodeBB) I'm seriously considering a block-style plugin for some of the use cases I'm thinking of using NodeBB for.
-
From the browsing I've done it seems that posts are stored all as blobs of HTML, or is that wrong?
-
What would it take to store posts in blocks? I'm specifically thinking MongoDB where we could store a nested array of blocks that comprise the post. Each block can have associated metadata like whether or not it is an embed, tags, mentions, etc. (This can be done in Redis as well). Mongo has performance issues when arrays grow constantly, but I'm assuming here that posts aren't typically edited to go from 2 paragraphs to 100.
Would someone with some understanding of the underlying data model and code mind shedding some light on this?
-
-
@agd1 Post content is stored as raw markdown with the regular composer.
WIth redactor, the post content is stored in HTML because that is the only lossless way of storing the input data. I'd much rather save tokenised JSON over HTML, but I haven't really looked into other ways Redactor can output entered content.
-
@julian I hear you. There's are some pretty amazingly smart people out there who may know something I don't, but the only way I have discovered of storing tokenized JSON from traditional WYSIWYG like Redactor is to do a HTML to JSON conversion (and there are plenty of Node libraries out there that do this). While this may be a feasible solution for basic use cases, in my experience it is an absolute nightmare when we start talking about embeds -- and the modern web is clearly all about embeds.
I've been giving some thought to writing a plugin for a block-style editor, as I'll need that for my own needs anyway, but it would be great to have some help. The benefits to me are many, and there are really one two downsides: it's new for some people and you lost the ability to next images to the right of left of text (but is that actually a benefit??).
Anyone have any opinions/thoughts/interest in a block-style editor?
-
I wanted to build one for actually modifying templates. Kinda widgets system 2.0
-
@psychobunny do you think it would be large effort to start storing posts in blocks vs entire blobs? Haven't quite dug in to learn NodeBB's code just yet.
the metadata associated with each block could be something like
{ blockIndex: Number, //the block number starting at 0 blockType: String, //text. header, image, video, iframely embed, etc. content: String, properties:{} }
-
@Drew-Llewellyn YES. When is it going to be integrated in nodeBB?
The standard composer is so bad......normal people cannot work with it in a normal way and get really frustrated when doing 10 minutes over 1 line of text...cannot even have a url within a visual -
@Danny-McWilliams @Ali @jarey @leksar @zerefel @Djeber-Boudiba
It's in its early stages, but it's an official NodeBB component:
https://community.nodebb.org/topic/6093/official-plugin-redactor-composer-now-available-in-0-7-1If any devs are able to contribute to adding all of the available functionality that'd be great.