- 授权协议: MIT
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: https://github.com/jayferd/rouge
- 软件文档: https://github.com/jayferd/rouge/wiki
软件介绍
Rouge 是一个纯 Ruby 实现的代码高亮库。它支持高亮 60 多种语言的代码,可以输出 HTML、ANSI-256 色文本格式。而且它的 HTML 输出兼容 Pygments 的语法高亮样式。
示例代码:
# make some nice lexed html
source = File.read('/etc/bashrc')
formatter = Rouge::Formatters::HTML.new(:css_class => 'highlight')
lexer = Rouge::Lexers::Shell.new
formatter.format(lexer.lex(source))
# Get some CSS
Rouge::Themes::ThankfulEyes.render(:scope => '.highlight')
它还提供了一个命令行的工具,可以这么使用:
rougify foo.rb
The Tangled Web
Michal Zalewski / No Starch Press / 2011-11-26 / USD 49.95
"Thorough and comprehensive coverage from one of the foremost experts in browser security." -Tavis Ormandy, Google Inc. Modern web applications are built on a tangle of technologies that have been de......一起来看看 《The Tangled Web》 这本书的介绍吧!
