SyntaxHighlighterを入れてみたので、テストする。
ついでに、lightbox系のwp-slimbox2も入れておく。
“[タグ]” source “[/タグ]”でOK
簡単に綺麗に整形してくれますね。
使えるタグは、http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/でいいのかな?
よく使いそうなのは、
shell , c , css , delphi , patch , java , perl , php , text , sql , xml あたりでしょうか。
phpの例
<?php
$options = get_option('inove_options');
if($options['feed'] && $options['feed_url']) {
if (substr(strtoupper($options['feed_url']), 0, 7) == 'HTTP://') {
$feed = $options['feed_url'];
} else {
$feed = 'http://' . $options['feed_url'];
}
} else {
$feed = get_bloginfo('rss2_url');
}
?>
cの例
#include <linux/version.h>
#if defined(CONFIG_HIGH_RES_TIMERS) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
#define USE_HIGHRESTIMER
#endif
#include <linux/kernel.h>
shellの例
#!/bin/bash
set -o nounset
set -o errexit
REPO_URI=${REPO_URI:-"https://github.com/Hexxeh/rpi-firmware"}
UPDATE_SELF=${UPDATE_SELF:-1}
UPDATE_URI="https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update"
if [[ ${BOOT_PATH:-"unset"} == "unset" && ${ROOT_PATH:-"unset"} != "unset" ]] ||
[[ ${BOOT_PATH:-"unset"} != "unset" && ${ROOT_PATH:-"unset"} == "unset" ]]; then
echo " *** You need to specify both ROOT_PATH and BOOT_PATH, or neither"
exit 1
fi