画像のサイズ指定を本文横幅に対するパーセンテージで行うため、modules/pearwiki_filter/pear_override/parse_mediawiki/Image.php に以下のコードを追加する。
else { $options['attr']['width'] = substr($part, 0, $pos); } } ////// ↓↓↓↓ ここから ↓↓↓↓ elseif ($pos = strpos($part, '%')) { if (strpos($part, 'x')) { list($width, $height) = explode('x', substr($part, 0, $pos)); $options['attr']['width'] = $width + '%'; $options['attr']['height'] = $height + '%'; } ////// ↑↑↑↑ ここまで ↑↑↑↑ else { $options['attr']['width'] = $part; $options['attr']['height'] = $part; } } else { $options['attr']['title'] = $part; }
pre記法をコマンドライン風の黒字に白文字にするため、modules/user/user.css の末尾に以下の行を追加する。
pre { color:white ; background-color: black ; margin-right: 50px ; padding: 0.5em; border-style: inset; border-width: 2px; border-radius: 10px; /* CSS3草案 */ -webkit-border-radius: 10px; /* Safari,Google Chrome用 */ -moz-border-radius: 10px; /* Firefox用 */ } div.content img { border: 1px solid #CCC; background: #FFF; padding: 2px; }