9款有用的Javascript代码高亮脚本
Syntax highlighting is very important especially when we want to show our code example on the blog. By enabling the syntax highlighting on the blog, readers can read the code blocks easier.
There are a lot of free and useful syntax highlighting scripts around us. Most of the scripts are written using Javascripts, though some of them are powered by other programming languages such as Phyton or Ruby.
Today, we are going to look into 9 Syntax Highlighting Scripts that powered by Javascript.
1. SyntaxHighlighter
I believe this is the most common syntax highlighting script used by most of us. It supports a lot of different languages and you can easily create new “brush” for your language if it is not supported by default. Check out the custom brushes list compiled by Abel Braaksma.
2. SHJS
SHJS stands for Syntax Highlighting in Javascript. It uses language definations from GNU Source-highlight and support a lot of different programming languages. SHJS has been tested and support major browsers sych as Firefox 2 and 3, IE 6 and 7, Opera 9.6, Safari 3.2 and Chrome 1.0.
3. beautyOfCode
beautyOfCode is a jQuery plugin for syntax highlighting. It uses the SyntaxHighlighter scripts by Alex Gorbatchev and makes it more XHTML-compliant.
4. Chili
Chili is a jQuery code syntax highlighting plugin. It comes bundled with recipes for a lot of languages and supports many configuration options.
5. Lighter.js
Lighter.js is a free syntax highlighting plugin for MooTools. Using lighter.cs is as simple as adding a single script to your webpage.
6. Highlight.js
highlight.js is easy to use and supports a lot of programming languages. It has some plugins for easily integrations to other CMS, forum or blog.
7. DlHighlight
DlHighlight is a simple syntax highlighting scripts that supports only 4 programming languages: JavaScript, CSS, XML, HTML.
8. Google Code Prettify
Google Code Prettify a Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page. It is the scripts wich powers code.google.com.
9. JUSH
JUSH is yet another jQuery syntax highlighting plugin which supports different programming languages such as HTML, CSS, PHP, PY and SQL.
来源: http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/
相关推荐
vue 使用monaco实现代码高亮 使用的是vue语言,用element的组件,要做一个在线编辑代码,要求输入代码内容,可以进行高亮展示,可以切换各不同语言,而且支持关键字补全,还要有一个各不同版本间的代码左右比较,...
如何实现正则表达式的JavaScript的代码高亮_.docx
易语言超级编辑框实现的javascript代码高亮。@zyx521147。
主要介绍了如何实现正则表达式的JavaScript的代码高亮方法,需要的朋友可以参考下
图片高亮显示在页面中很常见,下面是用jquery实现图片高亮显示的效果 html代码部分 <body> <div> /*添加图片*/ <img src="img/1.jpg"> <img src="img/2.jpg"> <img src="img/3.jpg"> ...
今天我们要来分享一些高性能的JavaScript代码高亮插件,这些JavaScript代码高亮插件将非常有效地帮你实现在网页上的代码编辑和展示。 1、SyntaxHighlighter – 最优秀的JavaScript代码高亮插件 ...
易语言超级编辑框实现的javascript代码高亮
Javascript实现CSS代码高亮显示 body{ font-size:12px; line-height:1.8; font-family:’Courier New’, Courier, monospace; } #area{ width:320px; height:120px; } body{ font-size:12px; line-...
关键词高亮技术各大CMS基本上都有,但基本都是后端代码来实现的,今天我们探讨下如何使用javascript来实现代码高亮技术。
程序拷贝到Word中,为了美观就需要自己手工来高亮,费时费力不容易实现,我就经常遇到这样的问题,所以就写了一个“花豹”代码高亮Word插件,能够自动一键高亮程序代码,使文档中的程序代码美观,专业,支持Office...
本资料介绍了两种能让文本中的关键字实现高亮显示的javascript的代码
非常不错的关键字高亮代码,用js实现,这个方法不错
支持当前流行的各种编程语言: C#、CSS、C++、Delphi、Java、JavaScript、PHP、Python、Ruby、SQL、Visual Basic、XML / HTML 使用方法: 1、假设网页文件test.htm存放在一个目录,则将dp.SyntaxHighlighter解压缩到...
导航菜单点击切换时保持高亮状态(JS实现)示例代码。尝试每个页面的导航栏目后加class=“active”属性进行修改不成功,这时就需要灵活使用javascript来搞定,主要用到添加类样式addClass(),删除类样式removeClass...
JS实现的代码语法高亮检测工具 支持C/C++、C#、CSS、Delphi/Kylix、Pascal、Java、Vb/Vb.net、J(ava)Script、ActionScript、Php、Python、Ruby/Rails、Perl、Assembly、批处理、UNIX Shell、AWK、Sql、xml/xhtml20...