內容簡介
強大、靈活、符合 XHTML 規範的伺服器端程式碼高亮外掛,特別感謝
Jay Pipes 和 GeSHi 的貢獻。
特點
支援任何語言的程式碼高亮
自動進行伺服器端處理(無需 JavaScript)
使用 XHTML 規範的 <div>、<ul>、<span> 標籤,包含 class 屬性和 CSS 樣式表
可選擇為每一個程式碼區塊增加標題
可選擇設定行號偏移值(會破壞 XHTML 規範)
可選擇不顯示行號
可為每一個程式碼區塊設定是否編碼 HTML 字元實體
僅會解析帶有 lang= 屬性的 <pre> 標籤,不會干擾您原本的預格式化內容
當使用的內容不乾淨時,會優雅降級為 <pre> 標籤
所有設定都是論理有效的參數,管理容易
內建通用的跨瀏覽器 CSS(經過 IE5.5+、Firefox、Safari、Opera 測試)
版本歷史
1.3:感謝大家的提示,現在樣式表的連結路徑已修正,對於帶來的困擾我們深感抱歉
1.2:不再去除行首的空白和換行字符,如果沒有標題,就不會產生標題的 <div>
1.1:解決使用單引號會被更換成替代引號的問題
已知問題
雖然本外掛基本符合 XHTML 1.0 標準,但是由於偏移值行號的顯示方式需要使用不當的 JavaScript 和 CSS Hack,因此如果您使用了偏移值行號,您的文件將無法通過驗證,因為 start= 屬性被禁用了。
文件
更多有關資訊請參閱 Highlight Source Pro 頁面。
外掛標籤
開發者團隊
原文外掛簡介
Powerful, flexible, XHTML-compliant, server-side code highlighting, credits for everything
but ‘making it a plugin’ go to Jay Pipes
and GeSHi.
Features
Highlight sources of any language
automatically, server-side (no javascripts)
XHTML-Compliant,
- , with class-attributes and a css-file are used for styling
optionally add a heading for every code-block
optionally specify line-number offset (BREAKS XHTML COMPLIANCE)
optionally don’t display line-numbers
set per-codeblock if the code is html_entity_encoded or not
only parses
-tags with the lang=-attribute, thus does not interfere with any regular preformatted contents you might have
degrades beautifully through-tags (if you keep the sources clean, that is)
all settings through logical, valid arguments for the main container
comes with generic cross-browser CSS (tested: IE5.5+, FF, Safari, Opera)Version History
1.3: Thanks to a tipp now the link-path to the stylesheets is correct, sorry for the inconvenience
1.2: Leading whitespace isn’t stripped anymore (indents as well as newlines), when there’s no title the title-div is not being generated anymore
1.1: Solved the issue with single-quotes being changed to typographical quotesKnown Issues
While the plugin is basically XHTML 1.0 Strict compliant there’s just no way of getting the offset-based line-numbering to display without inadequate (ab)use of javascript and css hacks, so be warned that IF you use the line-number offset, your documents will NOT validate because of the forbidden start=-attribute for the!
Documentation
More on the Highlight Source Pro Page延伸相關外掛
