內容簡介
SyntaxHighlighter Plus 是一個 WordPress 的外掛程式,用於程式碼語法高亮顯示。它是原始的 SyntaxHighlighter(由 Matt、Viper007Bond 和 mdawaffe)的增強版本。請給他們最大的掌聲,因為他們創造出這麼棒的外掛程式!
SyntaxHighlighter 讓您輕鬆地張貼具有語法高亮顯示的程式碼,而無需失去其格式或進行任何手動更改。
它支援以下語言(在文章中使用的別名在名稱旁列出):
Bash — bash、sh
C++ — cpp、c、c++
C# — c#、c-sharp、csharp
CSS — css
Delphi — delphi、pascal
Diff — diff
Groovy — groovy
Java — java
JavaScript — js、jscript、javascript
Perl — perl、pl
PHP — php
Plain text — plain、text
Python — py、python
Ruby — rb、ruby、rails、ror
Scala — scala
SQL — sql
VB — vb、vb.net
XML/HTML — xml、html、xhtml、xslt
此外掛程式使用 Alex Gorbatchev 的 SyntaxHighlighter JavaScript package。
其他 BBCode 方法
覺得 [sourcecode language='css']code here[/sourcecode] 過於冗長嗎?以下是一些替代的例子:
[source language='css']code here[/source]
[code language='css']code here[/code]
[sourcecode lang='css']code here[/sourcecode]
[source lang='css']code here[/source]
[code lang='css']code here[/code]
[sourcecode='css']code here[/sourcecode]
[source='css']code here[/source]
[code='css']code here[/code]
[lang='css']code here[/lang]
[css]code here[/css](或任何支援的語言)
註:語言周圍的引號可以省略,以獲得更短更整潔的語法。🙂
外掛標籤
開發者團隊
原文外掛簡介
SyntaxHighlighter Plus is a WordPress plugin for code syntax highlighting. It is an enhanced version of the original SyntaxHighlighter by Matt, Viper007Bond and mdawaffe. Please give them a big applause for making such a great plugin!
SyntaxHighlighter allows you to easily post syntax highlighted code all without loosing it’s formatting or making an manual changes.
It supports the following languages (the alias for use in the post is listed next to the name):
Bash — bash, sh
C++ — cpp, c, c++
C# — c#, c-sharp, csharp
CSS — css
Delphi — delphi, pascal
Diff — diff
Groovy — groovy
Java — java
JavaScript — js, jscript, javascript
Perl — perl, pl
PHP — php
Plain text — plain, text
Python — py, python
Ruby — rb, ruby, rails, ror
Scala — scala
SQL — sql
VB — vb, vb.net
XML/HTML — xml, html, xhtml, xslt
This plugin uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.
Other BBCode Methods
Find [sourcecode language='css']code here[/sourcecode] too long to type? Here’s some alternative examples:
[source language='css']code here[/source]
[code language='css']code here[/code]
[sourcecode lang='css']code here[/sourcecode]
[source lang='css']code here[/source]
[code lang='css']code here[/code]
[sourcecode='css']code here[/sourcecode]
[source='css']code here[/source]
[code='css']code here[/code]
[lang='css']code here[/lang]
[css]code here[/css] (or any of the supported language)
Note: Quotation marks around the language can be omitted for even shorter and neater syntax. 🙂
