Rails 项目的富文本编辑器

发布于 2024-12-12 19:06:42 字数 223 浏览 0 评论 0原文

我对 Rails 开发非常非常陌生。我已经阅读了反对使用所见即所得的富文本编辑器的论点。为了为我的作品集网站制作 CMS,我可以理解 RedCloth 并实现它。

我的问题是,当要写一篇很长的帖子时会发生什么,RedCloth 如何使我的工作更快?是否存在富文本编辑器更可取的场景?

如果这听起来很无知,请原谅我。我想了解针对我的情况最好的方法是什么。

谢谢你,

里希

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哽咽笑 2024-12-19 19:06:42

刚刚启动了两个替代方案的优点/缺点列表,请随时贡献

所见即所得编辑器

优点:

  • 非常容易设置(检查ckeditor这个小宝石
  • 对任何人来说都很容易使用能够使用Word...在某种程度上
  • 可以让您插入任何您想要的 html 代码/脚本

缺点:

Redcloth 网站 给出了为什么您不应该使用所见即所得编辑器的充分理由;其中:

  • 经常生成糟糕的、冗余的、语义上不正确的 html 代码,
  • 通常会让您的用户通过定义自己的样式来搞乱您网站的外观和感觉,填充在 html style 属性中
  • 可能会让您的用户感到困惑,因为它们不知道在 html 中“幕后”会发生什么(“为什么我不能将这张图片放在我想要的位置,在这个页面的中间?”)

Textile、Markdown 等。

优点:

  • 易于学习,易于使用
  • 通常会很好地激励用户生成语义正确、
  • 易于清理的结构化文档,除非您需要不被转义的 html
  • 不会扰乱您的网站风格,除非您允许用户使用该格式的高级功能,
  • 否则原始内容可读且结构良好
  • 原始内容所需的存储空间略少

缺点:

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
唯憾梦倾城 2024-12-19 19:06:42

这是个人选择,您应该使用您觉得舒服的任何东西,尤其是当您刚刚开始时。

有时,对于更高级的用户和制作特殊功能来说,所见即所得编辑器并不可取,这是因为它们使您远离实际的源代码并迫使您在其框架内工作。

这些编辑器对于更简单的工作来说是方便快捷的,正是因为它们提供了一个工作框架。

由于它不像代码框架或库,因此当您使用的所见即所得编辑器开始时,您总是可以进行切换限制你并妨碍你。 (只有你自己知道)

在那之前就继续吧!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文