DokuWikiプラグイン

Colorプラグイン

書式

<color 色名>テキスト</color>
<color #rgb>テキスト</color>
<color #rrggbb>テキスト</color>

サンプル

書式 表示
<color black>black</color> black
<color navy>navy</color> navy
<color blue>blue</color> blue
<color green>green</color> green
<color teal>teal</color> teal
<color lime>lime</color> lime
<color aqua>aqua</color> aqua
<color maroon>maroon</color> maroon
<color purple>purple</color> purple
<color olive>olive</color> olive
<color gray>gray</color> gray
<color silver>silver</color> silver
<color red>red</color> red
<color fuchsia>fuchsia</color>fuchsia
<color yellow>yellow</color> yellow
<color white>white</color> white
<color orange>orange</color> orange
<color #f00>f00</color> f00
<color #00ff00>00ff00</color> 00ff00

Keyboardプラグイン

書式

<key>キー文字</key>

サンプル

書式 表示
<key>a-b-c-d-z</key> A+B+C+D+Z
<key>S</key> Shift
<key>A</key> Alt
<key>C</key> Ctrl
<key>Up</key>
<key>Down</key>
<key>Left</key>
<key>Right</key>
<key>PageUp</key> Page↑
<key>PageDown</key> Page↓
<key>Minus</key>
<key>Ampersand</key> &
<key>LessThan</key> <
<key>GreaterThan</key>>
<key>その他</key> その他


スタイルシートは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フォルダを作成し入れます。

書式

<phpinc=ファイル名[?パラメータ1[&パラメータ2]]>
ファイル名には拡張子を付けない。

サンプル

dokuwikiの内容

<phpinc=test?param1=12&param2=あいう>
test.phpの内容
<?php
  var_dump($query);
?>
出力結果
array(2) { ["param1"]=> string(2) "12" ["param2"]=> string(9) "あいう" }

SyntaxHighlighter3プラグイン

書式

<sxh 種別;オプション>
コード
</sxh>

種別

ActionScript3as3,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 ? を表示しない

サンプル

<sxh php; title:サンプル; first-line:123; highlight:[132,134,136,137]; toolbar: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;
}

dokuwiki/プラグイン.txt · 最終更新: 2018/03/18 09:56 (外部編集)
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki