Movable Type 安装与配置(3): MTcodebeautifier 插件

(0 comments)

继续安装MTcodebeautifier 插件,支持美化ActionScript,PHP,Perl,Java,Scheme等程序代码。依照INSTALLATION将MTcodebeautifier 复制到相应目录中,然后在模板里面找到sytles.css,添加如下内容:

<!-- Code Beautifier colors -->
.linecomment { color: #FF8000; }
.blockcomment { color: #FF8000; }
.prepro { color: #0000BB; }
.select {}
.quote { color: #DD0000; }
.category1 { color: #007700; }
.category2 { color: #0000BB; }
.category3 { color: #0000BB; }

pre 
{
        border: 1px solid #888;
        background: #FFF;
        padding: 5px;
        overflow: auto;
        width: 95%;
        max-height: 450px;
        margin: 0px auto;
}

将日记默认文本格式设置为Textile2,MTcodebeautifier 推荐用bc[Language]的方式来标记代码:

bc[Perl]. use strict;
print "Hello world, i'm in MT now!\n";

上面的方式遇到代码中有空行就结束了,比较好的办法是用<code>将代码包含起来,如下所示:

==
<pre>
<code language="perl">use strict;
print "Hello world, i'm in MT now!\n";
</code>
</pre>
==

注意,==前后必须有空行。

Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required