语法高亮 [英] Syntax Highlighting

查看:118
本文介绍了语法高亮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找通用语法高亮库,以输出到html.

I'm looking for a general purpose syntax highlighting library, to output to html.

这是在ruby应用程序中使用的,因此ruby库会很好,但是可以通过管道输入和输出的出色实用程序都可以

It's for use within a ruby app, so a ruby library would be good, but an excellent utility which can be piped in and out of would do

还需要猜测适当的语言以使其突出显示

Also needs to guess the appropriate language to highlightsy by itself

推荐答案

基于HTML/CSS/JavaScript的语法突出显示解决方案最受欢迎,并且可以与包括Ruby在内的各种服务器技术一起很好地工作.

HTML/CSS/JavaScript based syntax highlighter solutions are the most popular and work well with different server technologies including Ruby.

  • SyntaxHighlighter (推荐)在这里帮助开发人员/编码人员轻松地在线发布代码段并使它们看起来很漂亮.它是基于100%Java脚本的,它并不关心服务器上的内容.

  • SyntaxHighlighter (RECOMMENDED) is here to help a developer/coder to post code snippets online with ease and have it look pretty. It's 100% Java Script based and it doesn't care what you have on your server.

语法突出显示 库,用于Rubyforge. org.内置支持将源代码转换为语法突出显示的HTML.

Syntax highlighting library for various languages at Rubyforge.org. Has built-in support for converting source code to syntax-highlighted HTML.

SyntaxHighlighter (适用于WordPress).它使您可以轻松地将语法突出显示的代码全部发布,而不会丢失其格式或进行手动更改.

SyntaxHighlighter for WordPress. It allows you to easily post syntax highlighted code all without losing its formatting or making an manual changes.

美化 .一个Javascript模块和CSS文件,允许在html页面中突出显示源代码片段的语法.

Prettify. A Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.

GeSHi-通用语法荧光笔 . GeSHi最初是为phpBB论坛系统创建通用语法荧光笔的想法,但已被推广到该项目. GeSHi旨在成为一个简单但功能强大的突出显示类,其目标如下:(1)支持多种流行语言(2)轻松添加新的突出显示语言(3)高度可定制的输出格式

GeSHi - Generic Syntax Highlighter. GeSHi started as an idea to create a generic syntax highlighter for the phpBB forum system, but has been generalised to this project. GeSHi aims to be a simple but powerful highlighting class, with the following goals: (1) Support for a wide range of popular languages (2) Easy to add a new language for highlighting (3) Highly customisable output formats

JUSH 是用以下语言编写的语法高亮组件: JavaScript.它突出显示了彼此嵌入的HTML,CSS,JS,PHP和SQL代码.除了语法突出显示之外,它还提供了所有受支持语言的文档链接.

JUSH is a syntax highlighting component written in JavaScript. It highlights HTML, CSS, JS, PHP and SQL code embedded into each other. Beside syntax highlighting, it provides links to the documentation for all supported languages.

适用于Windows Live Writer的SyntaxHighlighter ,位于CodePlex.com (以防万一:)

SyntaxHighlighter for Windows Live Writer at CodePlex.com (just in case :)

以下是有关该主题的一些博客文章:

And here a few blog posts on the subject:

  • Syntax Highlighting for Ruby Made Very Easy
  • Syntax highlighting in Ruby

这篇关于语法高亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆