- 浏览: 250674 次
- 性别:
- 来自: 南京
最新评论
-
spp_1987:
geojson 用什么工具软件来转换
GeoJSON and GeoJSON Plugin for GeoServer -
isaiahzhong:
我也是发现了这个问题,不过我使用try catc ...
Spring JDBC中queryForObject的零结果问题 -
dotjar:
主题让我含糊了
试用wxPython -
T_DDong:
...
操作表格的HTML DOM方法 -
houfeng0923:
楼主,问个问题。除了geoserver这样完整的开源gis服 ...
在JXMapKit上实现GetFeatureInfo
要使用highlight.js只需:
<script type="text/javascript" src="highlight.js"></script>
<script type="text/javascript">
initHighlightingOnLoad();
</script>
不过这样可能带来较慢的速度,你可以手动指定要高亮的语言。
<script type="text/javascript">
initHighlightingOnLoad('html', 'css');
</script>
在HTML中这样引用即可。
<pre><code class="html">...</code></pre>
要想改变默认的显示样式,可以对一些关键字的class修改样式。
.comment {
color: gray;
}
.keyword {
font-weight: bold;
}
.python .string {
color: blue;
}
.html .atribute .value {
color: green;
}
每种语言有一些类型,分别用CSS的类选择器就可以访问和修改。
Python:
keyword keyword
number number
string string (of any type)
comment comment
decorator @-decorator for functions
function function header "def some_name(...):"
class class header "class SomeName(...):"
title name of a function or a class inside a header
params everything inside parentheses in a function's or class' header
Ruby:
keyword keyword
string string
subst in-string substitution (#{...})
comment comment
function function header "def some_name(...):"
class class header "class SomeName(...):"
title name of a function or a class inside a header
symbol symbol
Perl:
keyword keyword
comment comment
number number
string string
regexp regular expression
sub subroutine header (from "sub" till "{")
variable variable starting with "$", "%", "@"
operator operator
pod plain old doc
PHP:
keyword keyword
number number
string string (of any type)
comment comment
phpdoc phpdoc params in comments
variable variable starting with "$"
HTML:
keyword HTML tag
tag any tag from "<" till ">"
comment comment
doctype <!DOCTYPE ... > declaration
attribute tag's attribute with or withou value
value attribute's value
CSS:
keyword HTML tag when in selectors, CSS keyword when in rules
id #some_name in selectors
class .some_name in selectors
attr_selector attribute selector (square brackets in a[href^=http://])
comment comment
rules everything from "{" till "}"
value property's value inside a rule, from ":" till ";" or
till the end of rule block
Django:
keyword HTML tag in HTML, default tags and default filters in templates
tag any tag from "<" till ">"
comment comment
doctype <!DOCTYPE ... > declaration
attribute tag's attribute with or withou value
value attribute's value
template_tag template tag {% .. %}
variable template variable {{ .. }}
template_comment template comment, both {# .. #} and {% comment %}
filter filter from "|" till the next filter or the end of tag
argument filter argument
Javascript:
keyword keyword
comment comment
number number
literal special literal: "true", "false" and "null"
string string
regexp regular expression
function header of a function
title name of a function inside a header
params everything inside parentheses in a function's header
VBScript:
keyword keyword
number number
string string
comment comment
built_in built-in function
Delphi:
keyword keyword
comment comment (of any type)
number number
string string
function header of a function, procedure, constructor and destructor
title name of a function, procedure, constructor or destructor
inside a header
params everything inside parentheses in a function's header
class class' body from "= class" till "end;"
Java:
keyword keyword
number number
string string
comment commment
annotaion annotation
javadoc javadoc comment
class class header from "class" till "{"
title class name inside a header
params everything in parentheses inside a class header
inheritance keywords "extends" and "implements" inside class header
C++:
keyword keyword
number number
string string and character
comment comment
preprocessor preprocessor directive
RenderMan (RSL):
keyword keyword
number number
string string
comment comment
preprocessor preprocessor directive
shader sahder keywords
shading shading keywords
built_in built-in function
RenderMan (RIB):
keyword keyword
number number
string string
comment comment
commands command
SQL:
keyword keyword (mostly SQL'92 and SQL'99)
number number
string string (of any type: "..", '..', `..`)
comment comment
aggregate aggregate function
Smalltalk:
keyword keyword
number number
string string
comment commment
symbol symbol
array array
class name of a class
char char
localvars block of local variables
Axapta:
keyword keyword
number number
string string
comment commment
class class header from "class" till "{"
title class name inside a header
params everything in parentheses inside a class header
inheritance keywords "extends" and "implements" inside class header
preprocessor preprocessor directive
1C:
keyword keyword
number number
string string
comment commment
function header of function or procudure
title function name inside a header
params everything in parentheses inside a function header
preprocessor preprocessor directive
也可以用下面的类选择器来禁用高亮
<pre><code class="no-highlight">...</code></pre>
highlight.js web site
http://softwaremaniacs.org/soft/highlight/en/
发表评论
-
操作表格的HTML DOM方法
2008-02-13 22:32 3000都DOM了还表格干嘛,不 ... -
Thunderbird in Mozilla
2007-08-01 06:25 1727我是一个Thunderbird的忠实用户,用它来管理我的Gma ... -
Node#setAttribute的一些问题
2007-07-20 00:54 2011一直以来IE对DOM中setAttribute方法的支持一直存 ... -
网络工业时代的现代主义
2006-12-19 10:30 1176自打当初Google以一种与 ... -
Rapib Develop
2006-12-26 14:30 965现在已经是晚上十点了,从今天早上八点半,我和samson开始做 ... -
Z-Blog Skin BlackO 0.1
2006-12-31 01:13 1191昨天晚上开始制作一个这样的Skin,因为之前对blog Ski ... -
最近几个网站的设计可用性检查
2007-01-03 12:45 1246我的网页制作还存在哪些问题呢,下面这些问题可以找到明确的答案。 ... -
感
2007-01-07 03:10 954上午起来,看到一篇文章讲的是用WPF(Windows Pres ... -
说说新主页
2007-01-09 10:00 1128最近,百合上关于南大 ... -
不可逾越的li
2007-01-23 08:40 1351今天制作了一个Javascript的popMenu动画特效,类 ... -
Using OpenLayers to develop a WebGIS Client
2007-02-06 08:16 3269OpenLayers是一个开源的js ... -
由target属性说开
2007-02-11 02:52 2633前两天毅博客上有一篇介绍详解target和rel属性的文章《详 ... -
该换了
2007-02-13 07:31 1051今天终于恨下心来在笔记本上也装上了IE7,这样我就可以彻底的和 ... -
虚拟校园飙进
2007-03-11 07:21 1456今天终于实现了在OpenLayers上显示marker,这一步 ... -
VeryFTP广告
2007-03-28 11:54 1086这次做的VeryFTP的广告采用cookie在客户端保存用户是 ... -
更新Blog主题:Quai
2007-04-25 12:29 1016前段时间就发现了一些和自己一摸一样的blog,暗生不爽,看来着 ... -
再也无法忍受抓虾了
2007-04-30 12:58 1209受不了了,自从我改用Opera之后,抓虾就一直摆出loadin ... -
被盗版??!!
2007-05-14 04:43 1135昨天遭遇了一件史无前例的骇人听闻的事情,当我在Google“某 ... -
南京大学素材库 Coming soon
2007-05-16 13:30 1803预计在五月二十日之前,工作室将推出“南京大学素材库”。这个项目 ... -
平台的大战:RIA
2007-06-12 05:45 1250都说2007年成为RIA的一年 ...
相关推荐
jQuery基于highlight.js高亮插件制作的代码着色高亮显示特效,下面有简单说明。
安装使用NPM安装react-highlight.js: npm install react-highlight.js --save 选择highlight.js主题,并确保它包含在索引文件中。 < link rel =' stylesheet ' href =' ...
highlight.js是一款轻量级的Web代码语法高亮库,它主要有以下几个特点: (1)、支持118种语言和54中样式; (2)、可以自动检测编程语言; (3)、同时为多种编程语言代码高亮; (4)、支持在node.js上是...
Highlight.js复制按钮插件。 用法 下载插件并在highlight.js之后包含文件: < script src =" path/to/highlight.min.js " > </ script > < script src =" path/to/highlightjs-copy-button.min.js ...
Highlight.js 是一个用 JavaScript 写的代码高亮插件,在客户端和服务端都能工作。它适用于几乎任何标记,不依赖于任何框架,并具有自动语言检测功能。
Vue Highlight.js :light_bulb: 具有Highlight.js v10支持的第4版正在开发中。 请参阅分支。 :scroll: 语法荧光笔组件。 :gear: 安装 通过 : npm install highlight.js vue-highlight.js 或: yarn add ...
angular2-highlight-js 与Angular的集成。 快速链接 安装 npm install --save angular2-highlight-js@latest highlight.js 用法 在angular.json中将您要使用的样式的highlight.js css添加到应用程序的样式中。 " ...
本篇文章主要介绍了js使用highlight.js高亮你的代码 ,非常具有实用价值,需要的朋友可以参考下
前端项目-highlight.js,使用语言自动检测突出显示语法。
seapig, SeaPig从 Markdown 到html的转换器,带有 marked.js 和 highlight.js SeaPig SeaPig从 Markdown 到html的转换器,带有 marked.js 和 highlight.js. 用法SeaPig有两个窗格左窗格是编辑器。 右窗格是HTML预览...
Highlight.js行号插件。 | 安装 凉亭 bower install highlightjs-line-numbers.js Npm npm install highlightjs-line-numbers.js 从CDN获取库 < script src =" //cdnjs.cloudflare....
vue-highlightjs使用highlight.js可以轻松突出显示Vue.js语法。 快速入门安装只需安装npm软件包vue-highlightjs:npm install --save vue-highlightjs使用vue-vue-highlightjs使用highlight.js即可轻松实现Vue.js...
本文实例讲述了JavaScript语法高亮库highlight.js用法。分享给大家供大家参考,具体如下: highlight.js是一款基于JavaScript的语法高亮库,目前支持125种编程语言,有63种可供选择的样式,而且能够做到语言自动识别...
highlight.js是一款轻量级的Web代码语法高亮库。下面通过实例代码给大家分享JS库之Highlight.js的用法详解,感兴趣的朋友跟随脚本之家小编一起学习吧
Highlightjs-line-numbers.js Highlight.js行号插件。 演示| 解决方法安装Bower bower安装Highlightjs-line-numbers.js Npm npm安装Highlightjs-line-numbers.js Highlightjs-line-numbers.js Highlight.js行号插件...
Asciidoctor Highlight.js 该项目提供了一个扩展,用于在文档转换期间使用突出显示源列表块(而不是在客户端浏览器中作为内置的 highlight.js 支持)。 它支持所有这样设有Asciidoctor如,一个代码和所有其他取代内...
Highlightr:基于 highlight.js,使用 Swift 实现的语法高亮库.zip,iOS & OSX Syntax Highlighter.
highlight.js是一个高亮显示插件,可实现网页上的搜索关键词高亮显示,如示例演示,在文本框中输入搜索的关键字,下面的一段文字中,所有出现搜索词的地方,都会被高亮显示,醒目的将结果显示给用户,而且使用起来...