Slate: Proposal for rendering read-only Slate

Created on 22 Jan 2019  Â·  5Comments  Â·  Source: ianstormtaylor/slate

Do you want to request a _feature_ or report a _bug_?

Feature

What's the current behavior?

There is no way to render a lite read-only version of a Slate editor

What's the expected behavior?

The desired behavior is to have something like this:

https://github.com/roast-cms/french-press-editor/blob/develop/src/components/vignettes/Reader.js

Either add to Editor or Docs.

docs

All 5 comments

Isn’t this read-only?

https://www.slatejs.org/#/read-only

@RyanBertrand

This was a proposal from somebody in the Slack channel I believe. I posted on somebody's behalf.

The proposal is for a lite read-only version. That is, without, all the other Editor related code. The idea was for the use case where a user publishes pages and they still need the renderer but they don't want all the Slate editing code to have to load in.

Hey Ryan, it does the same thing but only takes up 3.35 KB of uncompressed, unformatted code - much less if you optimize it.

Oh wow, much better. Thanks for letting me know!

On Feb 4, 2019, at 10:08 AM, dmitrizzle notifications@github.com wrote:

Hey Ryan, it does the same thing but only takes up 3.35 KB of uncompressed, unformatted code - much less if you optimize it.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Now that Slate's data model is pure JSON, this should be easier for folks to reason about. They can render the JSON to React components however they'd like, using a recursive rendering technique.

Was this page helpful?
0 / 5 - 0 ratings