wordrpess代码高亮插件使用

博主非码农,但是对专业与职业还是有相当的要求,在写网站代码的时候,适用了几个word press代码高亮插件,最终选定了SyntaxHighlighter Evolved插件。
插件介绍
插件名称:SyntaxHighlighter Evolved
插件作者:Viper007Bond, automattic
插件类型:代码高亮
中文支持:支持
安装环境:WordPress2.7或以上版本


效果演示
未处理过的源代码样式
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
<title>PHP Code Example</title>
</head>
<body>
<h1>PHP Code Example</h1>
<p><?php echo ‘Hello World!’; ?></p>
<p>This line is highlighted.</p>
<div>
This    is  an
example of  smart
tabs.
</div>
<p><a href=”http://wordpress.org/”>WordPress</a></p>
</body>
</html>

处理过的样式

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
    <title>PHP Code Example</title>
</head>
<body>
    <h1>PHP Code Example</h1>
    <p><?php echo ‘Hello World!’; ?></p>
    <p>This line is highlighted.</p>
    <div>
        This    is  an
        example of  smart
        tabs.
    </div>
    <p><a href=”http://wordpress.org/”>WordPress</a></p>
</body>
</html> 

使用方法:
本插件的使用很简单, 只要在HTML编辑模式下输入:[@php]你的代码[/php](用的时候把@去掉)。

作者: 远景顾问

Business consultant, focus on improving people, process and performance.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据