插件FCKeditor 和 SyntaxHighlighter 代码高亮插件的整合

syntaxhighlighter  时间:2021-04-18  阅读:()

http://taskcn.blog. 163.com/

FCKeditor和SyntaxHighlighter代码高亮插件的整合页面导航 →→→正文内容FCKeditor SyntaxHighlighter代码高亮插件FCKeditor和SyntaxHighlighter代码高亮插件的整合

FCKeditor和SyntaxHighlighter代码高亮插件的整合方法里面有下载可以根据需要结合自己的fckeditor版本。

Introduction 简介

This is a dialog-based plugin to handle formatting of source codefor . It WON'T work with the new (yet) . CKEditor是FCKEditor的升级版不过 SyntaxHighlighter还不能在CKEditor中实现代码高亮 Itmakes use of the SyntaxHighlighter 2.0.x javascript library availableto download from project page (the older version 1.5. 1 version isavailable from ) .

The plugin primiarily edits a pre tag with some custom attributes.Its mainly aimed at users editing blogs or content management systemswhere there is a requirement to format programming languages on awebsite that is being edited using FCKEditor.

The plugin will not format the code in FCKEditor - the

SyntaxHighlighter javascript library dynamically generates a lot offormatted HTML at runtime, which would cause problems in FCKEditor.Skip straight to the good bits

Can' t be bothered reading all this? or and go play with it yourself.So what do I get then?

Correctly installed, the plugin is in the form of a tabbed dialoguebox that looks like this: 插件安装好以后的效果http://taskcn.blog. 163.com/

http://taskcn.blog. 163.com/

Version history: 版本历史

Huge thanks goes to Sergey Gurevich who wrote the updated code forthe FCKEditor plugin to handle the latest version of the

SyntaxHighlighter code and submitted useful bug fixes.v2. 1.0 [23 May 2009]

- Plugin version information now being displayed

- Line highlighting feature added

|v2.0. 1 [22 March 2009]

Minor bug fix where semi-colons were sometimes positioned in thewrong place when no advanced options were selectedv2.0 [2 March 2009]

Latest version supporting SyntaxHighlighter 2.0.xv1.0.2 [2 March 2009]

Bug fixes, final release supporting the older SyntaxHighlighter 1.5. 1Note the instructions below are for the newer version of the libraryand makes references to syntaxhighlight2 a lot, this version useshttp://taskcn.blog. 163.com/

http://taskcn.blog. 163.com/

syntaxhighlight. The documentation in the download will be moreaccurate.

. |v1.0. 1 [10 Feb 2009] .v1.0 [30 Nov 2008] . First version. Known bugs:

Occasionally the dialogue box does not pickup the pre element to beedited in Firefox. It only seems to happen when a user clicks insidethe pre tag with the mouse but doesn' t actually move or interact withthe cursor.

Fixed in version 1.0.2 - Thanks to Sergey Gurevich

Installation 安装配置过程 1. Copying the files 拷贝文件

Extract the contents of the zip in your plugins directory, so it endsup like this: 基本的目录结构如下

Note: Version 2 of the plugin must be extracted to a directory named' syntaxhighlighter2' . The older plugin for the earlier version of thelibrary must go in a folder named ' syntaxhighlighter' . The filefckplugin. js references this directory when the plugin initialises.

注意这里的命名

2. Adding it to FCKeditor 将它添加到FCKeditorhttp://taskcn.blog. 163.com/

http://taskcn.blog. 163.com/

Now add in your fckconfig. js or custom js configuration file thefollowing line (remember its javascript we are dealing with soeverything is case sensitive!) :

3. Adding it to the toolbarset

Add the button 'SyntaxHighLight2' button to your toolbarset:

1.FCKConfig.ToolbarSets["Basic"] = [ 2. ['Bold' , ' Italic' , '-

' , 'OrderedList' , 'UnorderedList' , '-' , 'Link' , 'Unlink' , '-

' , 'SyntaxHighLight2' , '-' , 'About' ] 3. ] ; 4. Configure the pluginThe plugin will work 'out of the box' , but you can configure adefault language using the SyntaxHighlight2LangDefault parameter:

1.FCKConf ig.SyntaxHighlight2LangDefault = 'csharp' ;

The full list of languages and corresponding codes are:c++ - C++ csharp - C# css - CSS delphi - Delphi java - Java jscript- Java Script php - PHP python - Python ruby - Ruby sql - SQL vb -VB.NET xhtml - XML/HTML

In FCKEditor pre blocks aren' t really formatted by default. I suggestediting your fck_editorarea.css (or equivalant if you are using acustom CSS file) to something that highlights code blocks better. eg:

03. background-color: #fff; 04. font-family: "Consolas" , "CourierNew" ,Courier,mono, serif; 05. font-size: 12px; 06. color: blue;

07. padding: 5px; 08. border: 1px dashed blue; Configuring

SyntaxHighlighter.

You must have SyntaxHighlighter installed and working to displayproperly formatted code. FCKEditor does not need it, but for code tobe properly formatted on your website you must have it configuratedcorrectly. For SyntaxHighlighter2 has loads of excellent information(he wrote it after all!) , for the old version 1.5. 1 library, the is agood resouce, or post might also be useful.

5. Use ithttp://taskcn.blog. 163.com/

http://taskcn.blog. 163.com/

6. Future updates

There' s some additional functionality I might add at a later date:Preview tab using the SyntaxHighlighter library More configurationoptions, eg, available languages, path to SyntaxHighlighter filesDynamically adding a pre formatting style to the editor by default 7.And finally. . .

Thanks goes to Alex Gorbatchev for creating ! .

脚本之家打包下载地址http://taskcn.blog. 163.com/

创梦网络-新上雅安电信200G防护值内死扛,无视CC攻击,E5 32核高配/32G内存/1TB SSD/100Mbps独享物理机,原价1299,年未上新促销6折,仅779.4/月,续费同价

创梦网络怎么样,创梦网络公司位于四川省达州市,属于四川本地企业,资质齐全,IDC/ISP均有,从创梦网络这边租的服务器均可以****,属于一手资源,高防机柜、大带宽、高防IP业务,另外创梦网络近期还会上线四川眉山联通、广东优化线路高防机柜,CN2专线相关业务。广东电信大带宽近期可以预约机柜了,成都优化线路,机柜租用、服务器云服务器租用,适合建站做游戏,不须要在套CDN,全国访问快,直连省骨干,大网...

2021年国内/国外便宜VPS主机/云服务器商家推荐整理

2021年各大云服务商竞争尤为激烈,因为云服务商家的竞争我们可以选择更加便宜的VPS或云服务器,这样成本更低,选择空间更大。但是,如果我们是建站用途或者是稳定项目的,不要太过于追求便宜VPS或便宜云服务器,更需要追求稳定和服务。不同的商家有不同的特点,而且任何商家和线路不可能一直稳定,我们需要做的就是定期观察和数据定期备份。下面,请跟云服务器网(yuntue.com)小编来看一下2021年国内/国...

npidc:9元/月,cn2线路(不限流量)云服务器,金盾+天机+傲盾防御CC攻击,美国/香港/韩国

npidc全称No Problem Network Co.,Limited(冇問題(香港)科技有限公司,今年4月注册的)正在搞云服务器和独立服务器促销,数据中心有香港、美国、韩国,走CN2+BGP线路无视高峰堵塞,而且不限制流量,支持自定义内存、CPU、硬盘、带宽等,采用金盾+天机+傲盾防御系统拦截CC攻击,非常适合建站等用途。活动链接:https://www.npidc.com/act.html...

syntaxhighlighter为你推荐
汉语163计算机网络实验系统generatingcss动设备管理解决netbios端口26917 8000 4001 netbios-ns 端口 是干什么的ipad如何上网IPAD4怎样上网?ipad上网新买的ipad怎么用。什么装程序 怎么上网联通版iphone4s苹果4s怎么分移动版联通版电信版?google分析如何添加google analysis联通合约机iphone5想咨询一下联通iphone5合约机和裸机的区别?
网站空间购买 网通服务器租用 host1plus westhost 香港机房 香港托管 l5520 vmsnap3 三拼域名 阿里云浏览器 免空 admit的用法 双线主机 徐正曦 阿里校园 中国电信测速网 爱奇艺vip免费领取 免费外链相册 西安服务器托管 lamp怎么读 更多