简体   繁体   中英

Rich text editor for a Rails project

I am very, very new to Rails development. I have read the arguments against using Rich Text editors that are WYSIWYG. For the purpose of making a CMS for my portfolio site, I can understand RedCloth and implement it.

My question is what happens when there is a lengthy post to be written, how does RedCloth make my job faster? Is there a scenario where Rich Text editors would be preferable?

Pardon me if this sounds ignorant. I want to understand what the best approach is to my situation.

Thank you,

Rishi

just initiated a little pro/cons list of both alternatives, feel free to contribute

WYSIWIG editors

pros:

  • really easy to set up (check ckeditor and this little gem for instance)
  • easy to use for anyone able to use Word... to some point
  • lets you insert any html code / script you want

cons:

the Redcloth site gives sound reasons why you shouldn't use WYSIWYG editors ; among them :

  • often generates bad, redundant, semanticaly incorrect html code
  • often lets your users mess up with your site's look and feel by defining their own styles, stuffed in html style attributes
  • may confuse your users, beacuse they don't know what happens "under the hood", in html ("why can't i just place this picture where i want, in the middle of this page ?")

Textile, Markdown, etc.

pros:

  • easy to learn, easy to use
  • usually a good incentive on users to produce semantically correct, structured documents
  • easy to sanitize, unless you need the html not to be escaped
  • does not mess with your sites style, unless you allow the user to use advanced features of the format
  • raw content is readable and well-structured
  • slightly less storage space needed for raw content

cons:

  • your users have to learn it, and some don't love it (but WYSIWYG-style UIs do exist to help them ; just look at the good job StackOverflow did with theirs)
  • for advanced features you have to know the format well

It is a personal choice, you should use whatever you feel is comfortable, especially when you have just started.

WYSIWYG editors are some times not advisable for more advanced users and for making special features, this is because they distance you from the actual source code and force you to work within their frame.

These editors are convenient and quick for simpler work exactly because they give a frame to work in.

Since its not like a code framework or library, you can always make a switch when you are at a point when the WYSIWYG editor you are using is beginning to limit you and get in your way. (only you will know this)

Before then go right ahead!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM