如何将redcloth与coderay集成
我想将语法突出显示与红布一起使用。
Coderay的描述是这样的:
针对选定语言的快速、简单的语法突出显示,以 红宝石。配有 RedCloth 集成和 LOC 计数器。 1
但我没有找到有关如何执行此操作的文档?
我应该在哪里放置代码来进行突出显示?我考虑过将其放入 module ApplicationHelper
这是一个好主意吗?
I want to use syntax highlighting along with redcloth.
The description of coderay says:
Fast and easy syntax highlighting for selected languages, written in
Ruby. Comes with RedCloth integration and LOC counter. 1
But I did not find a documentation about how to do this?
Where should I put the code to do the hightlighting? I thought about putting it into module ApplicationHelper
is this a good idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项 1:
简单如下:http://railscasts .com/episodes/207-syntax-highlighting?autoplay=true
使用 Rails3 时,将助手更改为:
如果您使用 HAML,您将需要使用 ~ 符号:
选项 2:
CodeRay 内置了对 RedCloth 的支持。
我更喜欢第二种选择。
您可以在 http://en.wikipedia.org/ 找到有关使用 Textile 标记语言进行样式设置的更多信息。 wiki/Textile_(markup_language)
OPTION 1:
Simpe as this: http://railscasts.com/episodes/207-syntax-highlighting?autoplay=true
When using rails3 change helper to this:
If you use HAML you will want to use ~ sign:
OPTION 2:
CodeRay has built-in support for RedCloth.
I prefere the second option.
You can find more about styling with Textile markup language at http://en.wikipedia.org/wiki/Textile_(markup_language)