CEB2_plusUtilityカスタマイズ

投稿画面で、タグの挿入などをサポートするCEB2_plusUtilityプラグインをカスタマイズしてみます。
Googleのシンタックスハイライトgoogle-code-prettifyに対応するため、<code>タグにクラスを付与することができます。
なお、linenumsというのは行番号を表示させる場合のクラスです。
config.yamlの編集だけですが、431行目から、
preCode:
image: precode.gif
title: <pre><code></code></pre>
code: |
function ceb_preCode ( text ) {
text = text.replace(/&/g, "&");
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/"/g, """);
return '<pre><code>' + text + '</code></pre>';
}
を
preCode:
image: precode.gif
title: <pre><code class="prettyprint linenums"></code></pre>
code: |
function ceb_preCode ( text ) {
text = text.replace(/&/g, "&");
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/"/g, """);
return '<pre><code class="prettyprint linenums">' + text + '</code></pre>';
}
と書き換えます。





コメント