插件insertpre+语法高亮插件google-code-prettify,解决CKEditor4代码高亮显示问题
2012-12-21 14:58
786 查看
CKEditor4的外观界面我很喜欢,所以一直在使用,但是对代码高亮没有很好的支持,如何使代码高亮显示呢?使用插件insertpre+语法高亮插件google-code-prettify可以很好地解决这个问题。
一 下载地址
CKEditor4下载地址:http://ckeditor.com/download
insertpre plugin下载地址:http://ckeditor.com/addon/insertpre
google-code-prettify下载地址:http://code.google.com/p/google-code-prettify/downloads/list
二 insertpre插件安装方法
解压insertpre下载文件,将解压后的文件夹放到CKEditor的plugins下。
配置config.js,加入下面代码就可以使用insertpre功能了。
三 google-code-prettify语法高亮插件安装
解压下载文件,页面<head></head>间加入下面代码:
页面中<pre class="pettyprint"></pre>间的代码会自动语法高亮显示,下面是一个例子,里面的代码在pre标签间。
本文来自:http://www.suiyiwen.com/question/4270
一 下载地址
CKEditor4下载地址:http://ckeditor.com/download
insertpre plugin下载地址:http://ckeditor.com/addon/insertpre
google-code-prettify下载地址:http://code.google.com/p/google-code-prettify/downloads/list
二 insertpre插件安装方法
解压insertpre下载文件,将解压后的文件夹放到CKEditor的plugins下。
配置config.js,加入下面代码就可以使用insertpre功能了。
config.extraPlugins = 'insertpre'; //config.toolbar中加入"InsertPre"按钮。
三 google-code-prettify语法高亮插件安装
解压下载文件,页面<head></head>间加入下面代码:
<link href="prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="prettify.js"></script> <!--下面代码需要jquery.js支持--> <script type="text/javascript"> $(document).ready(function(){ prettyPrint(); }) </script>
页面中<pre class="pettyprint"></pre>间的代码会自动语法高亮显示,下面是一个例子,里面的代码在pre标签间。
int x = foo(); /* This is a comment <span class="nocode">This is not code</span> Continuation of comment */ int y = bar();
本文来自:http://www.suiyiwen.com/question/4270
相关文章推荐
- Tinymce 代码高亮插件(google-code-prettify)语法高亮
- 解决在用google-code-prettify高亮博客的代码,但是行号怎么也无法显示
- 使用google-code-prettify高亮显示网页代码
- 用google-code-prettify高亮代码
- 使用prettify为编辑器xhEditor添加代码(code)高亮显示
- 博客园设置Google-code-prettify渲染代码高亮
- 使用Google的prettify高亮显示代码
- SyntaxHighlighter代码高亮插件显示时第一行会多出几个空格问题。
- 如何解决eclipse中代码拷贝到word文档中高亮显示的问题
- Google Code Pretiffy 代码 着色 高亮 开源 javascript(JS)库
- 使用prettify为编辑器xhEditor添加代码(code)高亮显示
- 在很多论坛上看到了有人抱怨Flash CS5中,代码提示(Code hint)有时不显示的问题,这个问题可能有很多原因,我整理了几个解决办法,有可能可以帮助到你~
- cnblogs 代码高亮显示后的代码复制问题解决实现代码
- 五、Google Code Prettify:实现代码高亮的JS库
- google prettify 代码高亮显示
- push代码到code.google.com出错问题解决
- cnblogs 代码高亮显示后的代码复制问题解决实现代码
- Chrome58以上版本Goagent访问google显示不安全使用问题解决
- ListView失去焦点选中行不能高亮显示的问题解决
- Eclipse安装PyDev插件后,preference中不显示Pydev问题原因及解决办法