前言介紹
- 這款 WordPress 外掛「CodeColorer」是 2007-04-08 上架。
- 目前有 1000 個安裝啟用數。
- 上一次更新是 2023-05-29,距離現在已有 706 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
- 有 11 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
kpumuk |
外掛標籤
code | syntax | snippet | Highlight | highlighting |
內容簡介
CodeColorer 是一個外掛程式,它可以讓您在文章中插入代碼片段並添加漂亮的語法高亮效果。
此外掛程式基於 GeSHi庫建立,支援大多數語言。CodeColorer 的各種優秀功能包括:
在 RSS資訊中的語法高亮
單行代碼(內置)的語法高亮
評論中的代碼語法高亮
提供行號
自動插入相關文檔的鏈接
代碼塊智能滾動檢測(短代碼有短塊,對於長代碼,塊高度會固定並出現滾動條)
預定義的色彩主題(Slush&Poppies、Blackboard、Dawn、Mac Classic、Twitlight、Vibrant Ink、Railscasts、Solarized Light、Solarized Dark)
可以在 CSS文件中自定語法色彩
防止WordPress重整代碼的破壞保護(例如引號、雙條破折號等將顯示正確)
支援
如果您有任何建議,發現了漏洞,想為自己的語言貢獻譯文或只是想說“謝謝” - 請隨時通過電子郵件與我聯繫:[email protected]。我保證會回復每一封電子郵件。
如果您想貢獻代碼,請參見其他筆記選項卡下的 開發部分。
支援的語言
以下是 CodeColorer 支援的語言列表:4cs、6502acme、6502kickass、6502tasm、68000devpac、abap、actionscript、actionscript3、ada、aimms、algol68、apache、applescript、apt_sources、arm、asm、asp、asymptote、autoconf、autohotkey、autoit、avisynth、awk、bascomavr、bash、basic4gl、batch、bf、biblatex、bibtex、blitzbasic、bnf、boo、c、c_loadrunner、c_mac、c_winapi、caddcl、cadlisp、ceylon、cfdg、cfm、chaiscript、chapel、cil、clojure、cmake、cobol、coffeescript、cpp-qt、cpp-winapi、cpp、csharp、css、cuesheet、d、dart、dcl、dcpu16、dcs、delphi、diff、div、dos、dot、e、ecmascript、eiffel、email、epc、erlang、euphoria、ezt、f1、falcon、fo、fortran、freebasic、freeswitch、fsharp、gambas、gdb、genero、genie、gettext、glsl、gml、gnuplot、go、groovy、gwbasic、haskell、haxe、hicest、hq9plus、html4strict、html5、icon、idl、ini、inno、intercal、io、ispfpanel、j、java、java5、javascript、jcl、jquery、julia、kixtart、klonec、klonecpp、kotlin、latex、lb、ldif、lisp、llvm、locobasic、logtalk、lolcode、lotusformulas、lotusscript、lscript、lsl2、lua、m68k、magiksf、make、mapbasic、mathematica、matlab、mercury、metapost、mirc、mk-61、mmix、modula2、modula3、mpasm、mxml、mysql、nagios、netrexx、newlisp、nginx、nimrod、nsis、oberon2、objc、objeck、ocaml-brief、ocaml、octave、oobas、oorexx、oracle11、oracle8、oxygene、oz、parasail、parigp、pascal、pcre、per、perl、perl6、pf、phix、php-brief、php、pic16、pike、pixelbender、pli、plsql、postgresql、postscript、povray、powerbuilder、powershell、proftpd、progress、prolog、properties、providex、purebasic、pycon、pys60、python、q、qbasic、qml、racket、rails、rbs、rebol、reg、rexx、robots、rpmspec、rsplus、ruby、rust、sas、sass、scala、scheme、scilab、scl、sdlbasic、smalltalk、smarty、spark、sparql、sql、standardml、stonescript、swift、systemverilog、tcl、tclegg、teraterm、texgraph、text、thinbasic、tsql、twig、typoscript、unicon、upc、urbi、uscript、vala、vb、vbnet、vbscript、vedit、verilog、vhdl、vim、visualfoxpro、visualprolog、whitespace、whois、winbatch、xbasic、xml、xojo、xorg_conf、xpp、xyscript、yaml、z80、zxbasic。
開發
此外掛程式源代碼在 SVN 和 Git 上都可用:
WordPress SVN 存儲庫
原文外掛簡介
CodeColorer is the plugin which allows you to insert code snippets into the post with nice syntax highlighting.
Plugin based on GeSHi library, which supports most languages. CodeColorer has various nice features:
syntax highlighting in RSS feeds
syntax highlighting of a single line of code (inline)
syntax highlighting of code in comments
line numbers
automatic links to the documentation inserting
code block intelligent scroll detection (short code would have a short block, for a long one the block height would be fixed and a scrollbar would appear)
predefined color themes (Slush & Poppies, Blackboard, Dawn, Mac Classic, Twitlight, Vibrant Ink, Railscasts, Solarized Light, Solarized Dark)
syntax colors customization in CSS file
code protect from mangling by WordPress (for example, quotes, double-dashes, and others would look just right as you entered)
Support
If you have any suggestions, found a bug, wanted to contribute a translation to your language, or just wanted to say “thank you”,– feel free to email me [email protected]. Promise, I will answer every email I received.
If you want to contribute your code, see the Development section under the Other Notes tab.
Supported languages
Here is list of supported by CodeColorer languages: 4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, aimms, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, batch, bf, biblatex, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, c_winapi, caddcl, cadlisp, ceylon, cfdg, cfm, chaiscript, chapel, cil, clojure, cmake, cobol, coffeescript, cpp-qt, cpp-winapi, cpp, csharp, css, cuesheet, d, dart, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, ezt, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, ispfpanel, j, java, java5, javascript, jcl, jquery, julia, julia, kixtart, klonec, klonecpp, kotlin, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, mathematica, matlab, mercury, metapost, mirc, mk-61, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nginx, nimrod, nsis, oberon2, objc, objeck, ocaml-brief, ocaml, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, phix, php-brief, php, pic16, pike, pixelbender, pli, plsql, postgresql, postscript, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, qml, racket, rails, rbs, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, rust, sas, sass, scala, scheme, scilab, scl, sdlbasic, smalltalk, smarty, spark, sparql, sql, standardml, stonescript, swift, systemverilog, tcl, tclegg, teraterm, texgraph, text, thinbasic, tsql, twig, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vbscript, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xojo, xorg_conf, xpp, xyscript, yaml, z80, zxbasic.
Development
Sources of this plugin are available both in SVN and Git:
WordPress SVN repository
GitHub
Feel free to check them out, make your changes and send me patches or pull requests. Promise, I will apply every patch (of course, if they add a value to the product). Email for patches, suggestions, or bug reports: [email protected].
If you’re interested in translating CodeColorer to your language, please check out the translation page for the plugin.
Customization
Syntax coloring is highly customizable: you could change the color scheme for all languages or a specific language. You could find CodeColorer CSS in wp-content/plugins/codecolorer/codecolorer.css file. To change colors for all languages edit lines below Color scheme section.
There is simple mapping exists between Textmate color themes and CodeColorer ones:
/* "Slush & Poppies" color scheme (default) */
.codecolorer-container, .codecolorer { color: #000000; background-color: #F1F1F1; }
/* Comment */
.codecolorer .co0, .codecolorer .co1, .codecolorer .co2, .codecolorer .co3, .codecolorer .co4, .codecolorer .coMULTI { color: #406040; font-style: italic; }
/* Constant */
.codecolorer .nu0, .codecolorer .re3 { color: #0080A0; }
/* String */
.codecolorer .st0, .codecolorer .st_h, .codecolorer .es0, .codecolorer .es1 { color: #C03030; }
/* Entity */
.codecolorer .me1, .codecolorer .me2 { color: #0080FF; }
/* Keyword */
.codecolorer .kw1, .codecolorer .kw2, .codecolorer .sy1 { color: #2060A0; }
/* Storage */
.codecolorer .kw3, .codecolorer .kw4, .codecolorer .kw5, .codecolorer .re2 { color: #008080; }
/* Variable */
.codecolorer .re0, .codecolorer .re1 { color: #A08000; }
/* Global color */
.codecolorer .br0, .codecolorer .sy0 { color: #000000; }
Check the codecolorer.css file to get more examples.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「CodeColorer」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.5.1 | 0.6.0 | 0.7.0 | 0.7.2 | 0.7.3 | 0.8.0 | 0.8.1 | 0.8.2 | 0.8.3 | 0.8.4 | 0.8.5 | 0.8.6 | 0.8.7 | 0.9.0 | 0.9.1 | 0.9.2 | 0.9.3 | 0.9.4 | 0.9.5 | 0.9.6 | 0.9.7 | 0.9.8 | 0.9.9 | trunk | 0.10.0 | 0.10.1 | 0.9.10 | 0.9.11 | 0.9.12 | 0.9.13 | 0.9.14 | 0.9.15 | 0.9.16 |
延伸相關外掛(你可能也想知道)
Enlighter – Customizable Syntax Highlighter 》Enlighter 是一款免費且易於使用的 WordPress 語法高亮工具。其語法高亮效果是由 EnlighterJS javascript 函式庫所提供,能呈現出漂亮的程式碼外觀。, 您可以...。
Crayon Syntax Highlighter 》一款支援自訂語言和佈景主題的 PHP 和 jQuery 語法突顯外掛。, 它可以從 URL 或 WordPress 文章的文字中進行突顯。Crayon 讓管理語言檔案和使用正則表達式定...。
Custom HTML Block Extension 》Custom HTML Block Extension 擴展了「自定義 HTML 區塊」,使其演變成一個先進的程式碼編輯器。, 有 50 種不同的顏色主題可供選擇,您可以選擇一個最適合您...。
Urvanov Syntax Highlighter 》guage files, and there are many available on the plugin's website. The Urvanov Syntax Highlighter block is recommended for new posts instead of the...。
Code Prettify 》此外掛為自定版的Code Prettify library,支援本地樣式和腳本。此外掛會自動為頁面上的所有
標籤應用代碼高亮。, 支援古騰堡,且不會將您鎖定在特...。
WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages 》• 現場示範, • 亮點:, , 支援259種程式語言。, 適用於行動裝置:無需執行JavaScript,與基於JavaScript的解決方案相比可節省頻寬和電力。, 後端負載接近零。...。
Better WordPress Syntax Highlighter 》此外掛可讓您在文章中的程式碼中加入語法標註。它簡單、輕巧且非常容易使用,具有多種選項。此外掛可與編輯器一起使用,且不會破壞您的程式碼格式。此外掛使...。
Sticky CPT 》這個外掛程式可以像 WordPress 核心功能針對文章般,讓您也能對自訂文章類型(CPT)進行亮顯。, 您可以將新建立的自訂文章類型的內容亮顯。, 此外,也可以快...。
WP-code-button 》此外掛使用 Google Code Prettify 美化程式碼,可在 WordPress 博客文章中突顯程式碼片段。, 相關連結:, * 外掛首頁, * Google Code Prettify, 翻譯, 此外掛...。
SyntaxHighlighter Evolved: Cside Brush 》這款簡單的 WordPress 外掛程式可增強 SyntaxHighlighter Evolved 外掛,以支援 Dynamics NAV CAL Cside 程式語言。詳細使用說明,請參閱 此外掛程式的主頁。...。
Snippet Highlight 》在 phpblogger.net 上閱讀了關於 Dean Edwards 的 star-light 語法高亮庫之後,我決定將他們的教程結果製作成一個 WordPress 外掛,名為 Snippet-Highlight。...。
rtSyntax 》, 使用 highlight.js。, 內含 26 種佈景主題。, 支援 55 種語言 (其中 54 種為 highlight.js 支援,另外一種是針對 nginx 命令)。, 自動偵測語言。, 高度優化...。
Pygment It 》預設情況下,Pygment It 會自動檢測 Pygments 是否已安裝(透過命令 -v pygmentize)。如果沒有安裝,它將使用 http://pygments.appspot.com 來進行代碼高亮...。
Lite Syntax Highlighting 》這個外掛可輕鬆地為您的博客中的代碼添加語法突出顯示。您可以在文章和評論中使用短代碼,並且可以在任何地方使用 HTML 標籤。, 它為編輯器添加了一些按鈕,...。
CodeColorer comaptiblity with “Markdown for WordPress and bbPress” 》這個外掛會自動將四個空格或一個 tab 縮進的 Markdown 代碼塊包在 CodeColorer 標籤中。, 你也可以用以下語法指定程式碼片段使用的語言:, :ruby:, c...。