Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add medium editor #145

Closed
wants to merge 4 commits into from
Closed

Conversation

tswicegood
Copy link

This PR adds the react-medium-editor (React implementation of this editor). To see it in action, you need to change a field's type to wsyiwyg. I'm definitely open to other field name suggestions if you have them.

This gets the basics in place, but doesn't show the menubar. Could also still
use some styling to get it looking right.
For some reason, this isn't working. Not sure what's happening here as
webpack seems to be configured to treat .css files correctly. Committing
as a checkpoint for what should work.
Apparently WebPack isn't picking up CSS the way I thought it did. This
commit moves the call over to the Less file so it can be compiled there.
@tswicegood
Copy link
Author

FWIW, I didn't spend any time formatting this once it's dropped in. I think it might be worth a little bit more formatting to make it obvious what's going on with the editor area.

@mitsuhiko
Copy link
Member

Does this store it as HTML? (I did not look at the implementation yet, just want to understand what it does).

@tswicegood
Copy link
Author

@mitsuhiko yup -- it's just a presentation layer on top of HTML.

@mitsuhiko
Copy link
Member

Neat. I need to figure out if we should pull that into Lektor directly or if we can make it somehow work as a plugin. In theory I want something like this in core but i was always hoping it would generate markdown behind the scenes.

@jungornti
Copy link

Are there any ideas about implementing support different editors/widgets?

@singingwolfboy
Copy link
Member

Hey @tswicegood, thanks for the pull request! I'm going through some old pull requests to try to clean them out and get this project properly maintained again. Sorry for the long delay in getting to this!

I don't think it makes sense to store HTML directly -- it would be better to have an editor that renders & stores Markdown. I expect that most people using a WYSIWYG will be more comfortable with Markdown than HTML, anyway. There are several other WYSIWYG editor packages out there: I wonder if you can find one that works with Markdown? (I've found medium-editor-markdown, for example, but it's not implemented in React, unfortunately.) If so, I'd love to see a new pull request with that editor as the default for the markdown field type!

If you want to use this, you can always write a plugin for this editor type, but I don't think it makes sense to merge this into the core codebase as-is.

xlotlu pushed a commit that referenced this pull request Jun 13, 2020
xlotlu pushed a commit that referenced this pull request Jun 14, 2020
…t-error-fixes

Fix typos errors in model docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants