建站经验 experience
当前位置:首页 > 网站建设专题 > 建站经验
zblog博客实现代码高亮显示(插件)方法
发布日期:2011-08-11 阅读次数:701 字体大小:

代码高亮显示对于像我这个样的经常要写代码的博客很实用,我也一直在找,今天终于发现了一个效果不错的代码高亮显示插件。这个插件只需要按照配置一次,之后就可以在在线编辑器中轻松点击按钮实现添加代码了,后续操作很简单。

具体实现步骤如下:

首先下载:insertcodeRun.rar 文件

1.把文件夹放在 ADMIN\FCKeditor\editor\plugins

2.替换ADMIN\FCKeditor 下 的fckconfig.js

3.替换 ADMIN\FCKeditor\editor\lang下的zh-cn.js

4.在你的主题里修改single.html 加上下面两句!(修改后替换后,需要在后台中进行“文件重建”操作一下方可生效)

如果不需要复制代码功能,加上下面这个:

<link rel="stylesheet" type="text/css" href="http://www.chinaz.com/web/2011/0811/<#ZC_BLOG_HOST#>admin/fckeditor/editor/plugins/insertcodeRun/insertCode.css" />

如果想要复制代码功能,要加入两个调用:

<script type="text/javascript" src="http://www.chinaz.com/web/2011/0811/<#ZC_BLOG_HOST#>admin/fckeditor/editor/plugins/insertcodeRun/insertcodePage.js"></script>

<link rel="stylesheet" type="text/css" href="http://www.chinaz.com/web/2011/0811/<#ZC_BLOG_HOST#>admin/fckeditor/editor/plugins/insertcodeRun/insertCode.css"/>

其他的代码高亮插件也很多,这里在附一个代码高亮显示插件syntaxhighlighter,操作很简单,里面有实例可供参考。

点此下载syntaxhighlighter_2.0.320.zip

原创文章如转载,请注明转载自:优设前端 。