====== DokuWikiプラグイン ====== *[[#Colorプラグイン]] *[[#Keyboardプラグイン]] *[[#phpincプラグイン]] *[[#SyntaxHighlighter3プラグイン]] ====== Colorプラグイン ====== ===== 書式 ===== %%テキスト%%\\ %%テキスト%%\\ %%テキスト%%\\ ===== サンプル ===== ^ 書式 ^ 表示 ^ |%%black %%|black | |%%navy %%|navy | |%%blue %%|blue | |%%green %%|green | |%%teal %%|teal | |%%lime %%|lime | |%%aqua %%|aqua | |%%maroon %%|maroon | |%%purple %%|purple | |%%olive %%|olive | |%%gray %%|gray | |%%silver %%|silver | |%%red %%|red | |%%fuchsia%%|fuchsia| |%%yellow %%|yellow | |%%white %%|white | |%%orange %%|orange | |%%f00 %%|f00 | |%%00ff00 %%|00ff00 | ====== Keyboardプラグイン ====== ===== 書式 ===== %%キー文字%%\\ ===== サンプル ===== ^ 書式 ^ 表示 ^ |%%a-b-c-d-z %%|a-b-c-d-z | |%%S %%|S | |%%A %%|A | |%%C %%|C | |%%Up %%|Up | |%%Down %%|Down | |%%Left %%|Left | |%%Right %%|Right | |%%PageUp %%|PageUp | |%%PageDown %%|PageDown | |%%Minus %%|Minus | |%%Ampersand %%|Ampersand | |%%LessThan %%|LessThan | |%%GreaterThan%%|GreaterThan| |%%その他 %%|その他 | \\ スタイルシートは[[http://michaelhue.com/keyscss/|keys.css]]を真似て、以下のように調整しています。 /* --- keyboard plugin --- */ kbd { text-align: center; font-family: "メイリオ", "MS ゴシック", "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; font-weight: bold; padding: 0 .3em; margin: 0 .2em; min-width: 1em; -moz-border-radius: .3em !important; -webkit-border-radius: .3em !important; border-radius: .3em !important; background: rgb(250, 250, 250) !important; background: -moz-linear-gradient(top, rgb(210, 210, 210), rgb(255, 255, 255)) !important; background: -webkit-gradient(linear, left top, left bottom, from(rgb(210, 210, 210)), to(rgb(255, 255, 255))) !important; color: rgb(50, 50, 50) !important; text-shadow: 0 0 2px rgb(255, 255, 255) !important; -moz-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9) !important; -webkit-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9) !important; box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9) !important; } ====== phpincプラグイン ====== phpincプラグインは、外部phpファイルを実行するためのプラグインです。\\ ===== インストール ===== phpincプラグインは、プラグイン管理からインストールできる形で提供されていません。\\ インストール用に固めましたので、「プラグインのダウンロードとインストール」のURLに\\ http://photo.blogdns.net/ydlprog/download/software/phpinc.tgz\\ と入れてインストールしてください。\\ \\ 呼び出すphpは、ルート(confやdataがあるフォルダ)に、phpincludesフォルダを作成し入れます。 ===== 書式 ===== \\ ファイル名には拡張子を付けない。 ===== サンプル ===== dokuwikiの内容 test.phpの内容 出力結果 array(2) { ["param1"]=> string(2) "12" ["param2"]=> string(9) "あいう" } ====== SyntaxHighlighter3プラグイン ====== ===== 書式 ===== %%%%\\ コード\\ %%%%\\ ===== 種別 ===== ^ActionScript3|as3,actionscript3| ^Bash/shell |bash,shell| ^ColdFusion |cf, coldfusion| ^C# |c-sharp,csharp| ^C++ |cpp,c| ^CSS |css| ^Delphi |delphi,pas,pascal| ^Diff |diff,patch| ^Erlang |erl,erlang| ^Groovy |groovy| ^JavaScript |js,jscript,javascript| ^Java |java| ^JavaFX |jfx,javafx| ^Perl |perl,pl| ^PHP |php| ^Plain Text |plain,text| ^PowerShell |ps,powershell| ^Python |py,python| ^Ruby |rails,ror,ruby| ^Scala |scala| ^SQL |sql| ^Visual Basic |vb,vbnet| ^XML |xml,xhtml,xslt,html,xhtml| ===== オプション ===== オプションは;で区切り、キーと値は:で区切る。 ^auto-links | true |コード内のURLにリンクを貼らない| ^::: | false |コード内のURLにリンクを貼る| ^class-name | クラス名 |CSSのクラス名を指定しスタイルを変更する| ^collapse | true |ソースコードを最初は表示しない(折りたたむ)| ^::: | false |ソースコードを最初から表示| ^first-line | 10 |最初の行番号を10にする| ^gutter | true |行番号を表示| ^::: | false |行番号を非表示| ^highlight | 2 |2行目をハイライト| ^::: | [1,3] |1,3行目をハイライト| ^html-script| true |スクリプト内のhtmlを色分け表示する| ^::: | false |スクリプト内のhtmlを色分け表示しない| ^smart-tabs | |よくわかりません| ^tab-size | 4 |タブサイズ| ^toolbar | true |? を表示する| ^::: | false |? を表示しない| ===== サンプル ===== /* コード */ public static function encStr($str) {     $chfw = chfw::getInstance();       if(is_null($str) || !strlen($str)) {         error_log(__FILE__.':'.__LINE__);     }       $res = mcrypt_module_open(MCRYPT_BLOWFISH,'',MCRYPT_MODE_CBC,'');     $iv  = sprintf('%08x',crc32($str));     mcrypt_generic_init($res,$chfw->appConf['cryptKey'],$iv);       $enc = $iv.mcrypt_generic($res,$str);       mcrypt_generic_deinit($res);     mcrypt_module_close($res);       // 16進数エンコード     $res = '';     for($i = 0 ; $i < strlen($enc) ; ++ $i) {         $res .= sprintf('%02x',ord($enc[$i]));     }       return $res; } スタイルは以下のようにカスタマイズしています @charset "utf-8"; /* タイトルの色 */ .syntaxhighlighter { background-color: #224488 !important; } /* 偶数ラインの背景色 */ .syntaxhighlighter .line.alt1 { background-color: #112222 !important; } /* 奇数ラインの背景色 */ .syntaxhighlighter .line.alt2 { background-color: #081616 !important; } /* ハイライト時の背景色 */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #334c55 !important; } /* */ .syntaxhighlighter .line.highlighted.number { color: #b9bdb6 !important; } /* タイトルの文字色 */ .syntaxhighlighter table caption { padding: 2px 8px !important; color: #dddddd !important; } /* 行番号 */ .syntaxhighlighter .gutter { color: #afafaf !important; } /* 行番号の背景 */ .syntaxhighlighter .gutter .line { border-right: 2px solid #435a5f !important; } /* ハイライト時の行番号の背景色*/ .syntaxhighlighter .gutter .line.highlighted { background-color: #334c55 !important; color: #dddddd !important; } /* */ .syntaxhighlighter.printing .line .content { border: none !important; } /* */ .syntaxhighlighter.collapsed { overflow: visible !important; } /* */ .syntaxhighlighter.collapsed .toolbar { color: #5ba1cf !important; background: black !important; border: 1px solid #435a5f !important; } /* */ .syntaxhighlighter.collapsed .toolbar a { color: #5ba1cf !important; } /* */ .syntaxhighlighter.collapsed .toolbar a:hover { color: #5ce638 !important; } /* ヘルプ */ .syntaxhighlighter .toolbar { color: white !important; background: #ff4411 !important; border: none !important; } .syntaxhighlighter .toolbar a { color: white !important; } .syntaxhighlighter .toolbar a:hover { color: white !important; } /* コードのデフォルト色 */ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #cccccc !important; } /* コメント */ .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #66cc66 !important; } /* 文字列 */ .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #ff66bb !important; } /* 基本予約語 */ .syntaxhighlighter .keyword { color: #66aadd !important; } /* プリプロセッサ */ .syntaxhighlighter .preprocessor { color: #ff00bb !important; } /* 変数 */ .syntaxhighlighter .variable { color: #ffaa33 !important; } /* 数値 */ .syntaxhighlighter .value { color: #00dddd !important; } /* 関数 */ .syntaxhighlighter .functions { color: #66aadd !important; } /* 定数 */ .syntaxhighlighter .constants { color: #66aadd !important; } /* */ .syntaxhighlighter .script { font-weight: bold !important; color: #5ba1cf !important; background-color: none !important; } /* 型 */ .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #e0e8ff !important; } /* */ .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #e0e8ff !important; } /* */ .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #e0e8ff !important; }