Title: Syntax Highlighter MT
Author: iamthechad
Published: <strong>2009 年 10 月 22 日</strong>
Last modified: 2015 年 8 月 18 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/syntax-highlighter-mt.svg)

# Syntax Highlighter MT

 作者：[iamthechad](https://profiles.wordpress.org/iamthechad/)

[下载](https://downloads.wordpress.org/plugin/syntax-highlighter-mt.2.2.5.zip)

 * [详情](https://cn.wordpress.org/plugins/syntax-highlighter-mt/#description)
 * [评价](https://cn.wordpress.org/plugins/syntax-highlighter-mt/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/syntax-highlighter-mt/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/syntax-highlighter-mt/#developers)

 [支持](https://wordpress.org/support/plugin/syntax-highlighter-mt/)

## 描述

This plugin works like many of the others that enable the use of the Syntax Highlighter
tool. Dynamic plugin loading
 is now available as part of the Syntax Highlighter
tool, making brush configuration obsolete.

Available brushes are:
 applescript actionscript3 as3 bash shell coldfusion cf cpp
c c# c-sharp csharp css delphi pascal diff patch pas erl erlang groovy hive java
jfx javafx js jscript javascript objc obj-c perl pl php pig text plain py python
ruby rails ror rb sass scss scala sql vb vbnet xml xhtml xslt html

### Changing display themes

The display theme can be changed by navigating to `Settings` -> `Syntax Highlighter
MT`. The themes available are:

 * Default
 * Django
 * Eclipse
 * Emacs
 * FadeToGrey
 * MDUltra
 * Midnight
 * RDark

### Advanced Usage

#### Changing the appearance of code

There are many options that can be applied inline to control how your formatted 
code is displayed. These are appended to the class definition after the brush declaration.

#### auto-links

_Enabled_ by default. Disabling this turns off link detection in the highlighted
section, making URLs non-clickable.

    ```
    <pre class="brush: java; auto-links: false">
    String link = "http://www.megatome.com";
    </pre>
    ```

#### class-name

Use this to specify one or more classes that should be applied to the generated 
highlight element.

#### collapse

_False_ by default. Forces the highlighted code to be collapsed by default.

#### first-line

1 by default. Change the starting line number for a section of highlighted code.

    ```
    <pre class="brush: java; first-line: 20">
    String link = "http://www.megatome.com";
    </pre>
    ```

#### gutter

_Enabled_ by default. Turn the line numbers on and off.

    ```
    <pre class="brush: java; gutter: false">
    String link = "http://www.megatome.com";
    </pre>
    ```

#### highlight

Specify one or more lines to be highlighted.

    ```
    <pre class="brush: java; highlight: [1, 3]">
    String link = "http://www.megatome.com";
    System.out.println("Hello World");
    System.out.println("Goodbye World");
    </pre>
    ```

#### toolbar

_Enabled_ by default. Toggle the toolbar.

    ```
    <pre class="brush: java; toolbar: false">
    String link = "http://www.megatome.com";
    </pre>
    ```

#### title

Allows a title to be set for a block of code. This is not in the class, but in the`
<pre/>` or `<script/>` tags.

    ```
    <pre class="brush: java" title="Here is some Java">
    String link = "http://www.megatome.com";
    </pre>
    ```

Take a look at [http://alexgorbatchev.com/wiki/SyntaxHighlighter](http://alexgorbatchev.com/wiki/SyntaxHighlighter)
for the documentation on using the Syntax Highlighter tool.

## 屏幕截图

 * [[
 * Styled Groovy code.
 * [[
 * Styled Groovy code using the Django theme.
 * [[
 * Styled Groovy code using the FadeToGrey theme.

## 安装

 1. Unzip the `syntax-highlighter-mt` directory and upload it to `/wp-content/plugins/`
    directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常见问题

  Highlighting code

The basic usage is: `<pre class="brush:brush_name">...code...</pre>` where `brush_name`
is one of the available brushes.

  Why does my content containing “<” and “>” get messed up?

This is an issue with using the `<pre />` tags. Replace the `<` characters with 
their entity escape of `&lt;` to get the desired result.
 See http://alexgorbatchev.
com/SyntaxHighlighter/manual/installation.html for more discussion. (Note that this
issue only happens if you are using the `<pre />` tags to surround the highlighted
code.)

  I get an error saying “Can’t find brush for: xxx”

The most likely issue is that the specified brush is not available as part of the
plugin install.

  Why “Syntax Highlighter MT”?

There are several plugins already that are named Syntax Highlighter, or some variant.
I added “MT” (for Megatome Technologies – my company) to the name to make it unique.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Syntax Highlighter MT」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ iamthechad ](https://profiles.wordpress.org/iamthechad/)

[帮助将「Syntax Highlighter MT」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/syntax-highlighter-mt)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/syntax-highlighter-mt/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/syntax-highlighter-mt/)，或通过[RSS](https://plugins.trac.wordpress.org/log/syntax-highlighter-mt/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/syntax-highlighter-mt/)。

## 更新日志

#### 2.2.5

 * Verified to work with WordPress 4.1.

#### 2.2.4

 * Verified to work with WordPress 3.9.
 * Updated docs to describe changing themes. ([GitHub Issue #2](https://github.com/iamthechad/syntaxhighlightermt/issues/2))
 * Properly serve assets over HTTPS as well as HTTP. ([GitHub Issue #1](https://github.com/iamthechad/syntaxhighlightermt/issues/1))

#### 2.2.3

 * Verified to work with WordPress 3.8.
 * Updated docs to include advanced usage.

#### 2.2.2

 * Added brushes for Pig and Hive QL.

#### 2.2.1

 * No functional changes. Just updating the compatible WP version numbers to be 
   the most recent.

#### 2.2

 * Added Objective C brush.

#### 2.1

 * Added ability to select coloration theme. This is a global setting.

#### 2.0.1

 * No functional changes. Just updating the compatible WP version numbers to be 
   the most recent.

#### 2.0

 * Incorporate Syntax Highlighter 3.0.83
 * Remove option page for enabled brushes since the Syntax Highlighter tool now 
   uses dynamic loading

#### 1.0

 * Initial Version

## 额外信息

 *  版本 **2.2.5**
 *  最后更新：**11 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 2.7.1 或更高版本 **
 *  已测试的最高版本为 **4.3.0**
 *  语言
 * [English (US)](https://wordpress.org/plugins/syntax-highlighter-mt/)
 * 标签
 * [code](https://cn.wordpress.org/plugins/tags/code/)[Code Highlight](https://cn.wordpress.org/plugins/tags/code-highlight/)
   [Highlight](https://cn.wordpress.org/plugins/tags/highlight/)[syntax](https://cn.wordpress.org/plugins/tags/syntax/)
 *  [高级视图](https://cn.wordpress.org/plugins/syntax-highlighter-mt/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/syntax-highlighter-mt/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/syntax-highlighter-mt/reviews/)

## 贡献者

 *   [ iamthechad ](https://profiles.wordpress.org/iamthechad/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/syntax-highlighter-mt/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://www.megatome.com/syntaxhighlighter/)