• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >网页编辑器 > FCKeditor 和 SyntaxHighlighter 代码高亮插件的整合

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

作者: 字体:[增加 减小] 来源:互联网 时间:2017-06-05

本文主要包含syntaxhighlighter,代码高亮插件,od高亮插件,sublime高亮插件,高亮插件等相关知识, 希望在学习及工作中可以帮助到您

Introduction(简介)

This is a dialog-based plugin to handle formatting of source code for FCKeditor 2.5.x. It WON'T work with the new CKEditor (yet).(CKEditor 是FCKEditor 的升级版,不过,SyntaxHighlighter 还不能在 CKEditor 中实现代码高亮) It makes use of the SyntaxHighlighter 2.0.x javascript library available to download from Alex Gorbatchev's project page (the older version 1.5.1 version is available from Google Code).

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

The plugin will not format the code in FCKEditor - the SyntaxHighlighter javascript library dynamically generates a lot of formatted HTML at runtime, which would cause problems in FCKEditor.

Skip straight to the good bits

Can't be bothered reading all this? View the online demo or download the plugin and go play with it yourself.

So what do I get then?

Correctly installed, the plugin is in the form of a tabbed dialogue box that looks like this:(插件安装好以后的效果)

Version history:(版本历史)

Huge thanks goes to Sergey Gurevich who wrote the updated code for the 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
    Download | Demo
     
  • v2.0.1 [22 March 2009]
    Minor bug fix where semi-colons were sometimes positioned in the wrong place when no advanced options were selected
    Download
     
  • v2.0 [2 March 2009]
    Latest version supporting SyntaxHighlighter 2.0.x
     
  • v1.0.2 [2 March 2009]
    Bug fixes, final release supporting the older SyntaxHighlighter 1.5.1
    Note the instructions below are for the newer version of the library and makes references to syntaxhighlight2 a lot, this version uses syntaxhighlight. The documentation in the download will be more accurate.
    Download.| Demo
     
  • 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 be edited in Firefox. It only seems to happen when a user clicks inside the <pre> tag with the mouse but doesn't actually move or interact with the 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 ends up like this:(基本的目录结构如下)

Note: Version 2 of the plugin must be extracted to a directory named 'syntaxhighlighter2'. The older plugin for the earlier version of the library must go in a folder named 'syntaxhighlighter'. The file fckplugin.js references this directory when the plugin initialises.(注意这里的命名)

2. Adding it to FCKeditor(将它添加到 FCKeditor)

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

</div></div></div>

3. Adding it to the toolbarset

Add the button 'SyntaxHighLight2' button to your toolbarset: 

</div> </div> </div></div></div>

4. Configure the plugin

The plugin will work 'out of the box', but you can configure a default language using the SyntaxHighlight2LangDefault parameter:

您可能想查找下面的文章:

  • ckeditor syntaxhighlighter代码高亮插件配置分享
  • CKEditor中加入syntaxhighlighter代码高亮插件
  • 解决SyntaxHighlighter 代码高亮不换行问题的解决方法
  • FCKeditor + SyntaxHighlighter 让代码高亮着色插件
  • syntaxhighlighter 去掉右上角问号图标的三种方法
  • 为SyntaxHighlighter添加新语言的方法
  • SyntaxHighlighter配合CKEditor插件轻松打造代码语法着色
  • ckeditor syntaxhighlighter代码高亮插件,完美修复
  • FCKeditor 和 SyntaxHighlighter 代码高亮插件的整合
  • SyntaxHighlighter 语法高亮插件的使用教程

相关文章

  • 2017-06-0519款Javascript富文本网页编辑器
  • 2017-06-05CKEDITOR二次开发之插件开发方法
  • 2017-06-05ckeditor插件开发简单实例
  • 2017-06-05FCKeditor 和 SyntaxHighlighter 代码高亮插件的整合
  • 2017-06-05Js FCKeditor的值获取和修改的代码小结
  • 2017-06-05常用网页编辑器漏洞手册(全面版)fckeditor,ewebeditor
  • 2017-06-05UEditor编辑文章出现多余空行问题的解决办法
  • 2017-06-05百度编辑器Ueditor增加字体的修改方法
  • 2017-06-05fckeditor常用Js,获取fckeditor内容,统计fckeditor字数,向fckeditor写入指定代码
  • 2017-06-05FCK判断内容是否为空(如果只是去空格,那么这种方式是错误的)

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • fckeditor编辑器在php中的配置方法
    • javascript fckeditor编辑器取值与赋值实现代码
    • 页面嵌入Windows Media Player播放器代码需要注意的
    • 针对PHP环境下Fckeditor编辑器上传图片配置详细教程
    • Ueditor百度编辑器的Html模式自动替换样式的解决方法
    • FCKeditor 和 SyntaxHighlighter 代码高亮插件的整合
    • Fckeditor XML Request error:internal server error (500) 解决方法小结
    • 彻底解决ewebeditor网站后台不能上传图片的方法
    • FCKeditor添加自定义按钮的方法
    • FCKeditor smarty 编辑器的应用PHP

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有