插件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/

标准互联(450元)襄阳电信100G防御服务器 10M独立带宽

目前在标准互联这边有两台香港云服务器产品,这不看到有通知到期提醒才关注到。平时我还是很少去登录这个服务商的,这个服务商最近一年的促销信息比较少,这个和他们的运营策略有关系。已经从开始的倾向低价和个人用户云服务器市场,开始转型到中高端个人和企业用户的独立服务器。在这篇文章中,有看到标准互联有推出襄阳电信高防服务器100GB防御。有三款促销方案我们有需要可以看看。我们看看几款方案配置。型号内存硬盘IP...

RackNerd新上圣何塞、芝加哥、达拉斯、亚特兰大INTEL系列,$9.49/年

racknerd怎么样?racknerd商家最近促销三款美国便宜vps,最低只需要9.49美元,可以选择美国圣何塞、西雅图、纽约和芝加哥机房。RackNerd是一家成立于2019年的美国高性价比服务器商家,主要从事美国和荷兰数据中心的便宜vps、独立服务器销售!支持中文工单、支持支付宝和微信以及PayPal付款购买!点击直达:racknerd官方网站INTEL系列可选机房:加利福尼亚州圣何塞、芝加...

Hostigger不限流量VPS年20美元

Hostigger 主机商在前面的文章中也有介绍过几次,这个商家运营时间是有一些年份,只不过在我们圈内好像之前出现的次数不多。最近这段时间商家有提供不限流量的VPS主机,逐渐的慢慢被人认识到。在前面的介绍到他们提供的机房还是比较多的,比如土耳其、美国等。今天看到Hostigger 商家居然改动挺大的,原来蛮好的域名居然这次连带官方域名都更换掉去掉一个G(Hostiger )。估摸着这个域名也是之前...

syntaxhighlighter为你推荐
中南财经政法大学知识产权研究中心Toolgraph模块ios8水土保持ios8支持ipad齐鲁工业大学高水平学科建设专项windows键是哪个Win键是什么?勒索病毒win7补丁我的电脑是windows7系统,为什么打不了针对勒索病毒的补丁(杀毒软件显itunes备份怎么使用iTunes备份win7telnetWin7系统中的telnet命令如何应用?
mach5 论坛空间 申请个人网页 seednet softbank邮箱 河南m值兑换 免费全能主机 isp服务商 吉林铁通 便宜空间 网站加速软件 新加坡空间 阿里云邮箱登陆地址 如何登陆阿里云邮箱 国外免费云空间 97rb asp空间 9929 主机声音大 免费网络电视直播 更多