自作プラグイン/emphasis.inc.php
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
** emphasis.inc.php [#wdd83cf6]
|RIGHT:100|LEFT:360|c
|~サマリ|圏点表示|
|~リビジョン|1.01|
|~対応バージョン|1.5.x|
|~投稿者|[[M.Taniguchi]]|
|~投稿日|&new{2019-08-03 (土) 00:48:46};|
**概要 [#oba072a8]
文字列に圏点(傍点・脇点)を付加するプラグイン。&br;
CSS3の text-emphasis-style を利用するため、対応ブラウザー...
**使い方 [#rcb135cf]
-&emphasis(){文字列}
-&emphasis(圏点種別){文字列}
&br;''引数''
-文字列 … 圏点を付加したい文字列
-圏点種別 … [filled|open] [dot|circle|double-circle|trian...
&br;''使用例''
これは&emphasis(){強調文字列}です。
**コード [#m0f82c40]
emphasis.inc.php~
(下記のコードをコピーして、plugin ディレクトリに emphasi...
<?php
/*
PukiWiki - Yet another WikiWikiWeb clone.
emphasis.inc.php, v1.01 2019 M.Taniguchi
License: GPL v3 or (at your option) any later version
文字列に圏点(傍点・脇点)を付加するPukiWiki用プラグイン。
CSS3の text-emphasis-style を利用するため、対応ブラウザ...
使い方:
&emphasis(){文字列}
&emphasis(圏点種別){文字列}
引数:
文字列 … 圏点を付加したい文字列
圏点種別 … [filled|open] [dot|circle|double-circle|trian...
*/
define('PLUGIN_EMPHASIS_USAGE', '&emphasis([emphasis typ...
define('PLUGIN_EMPHASIS_CLASS', false); // style属性の代...
function plugin_emphasis_inline() {
$argNum = func_num_args();
if ($argNum <= 0) return PLUGIN_EMPHASIS_USAGE;
$emphasis = 'filled';
if ($argNum == 1) {
list($body) = func_get_args();
} else {
list($emphasis, $body) = func_get_args();
}
$body = strip_htmltag($body);
if ($body == '') return PLUGIN_EMPHASIS_USAGE;
$emphasis = strip_htmltag($emphasis);
if (PLUGIN_EMPHASIS_CLASS) {
$emphasis = str_replace(' ', '-', $emphasis);
$html = '<span class="emphasis-' . $emphasis . '">' . ...
} else {
$html = '<span style="-webkit-text-emphasis-style:' . ...
}
return $html;
}
?>
**ライセンス [#z5e38841]
GPL v3
**ユーザ定義ルール版 [#o76d05e7]
このプラグインを導入しなくても、default.ini.php の $line_...
プラグインを作ったあとで気づきました。
'EMPHASIS\(([^\(\)]*)\){([^}]*)}' => '<span style="-webk...
#br
''使い方''
EMPHASIS(filled){強調したい文字列}&br;
EMPHASIS(open sesame){強調したい文字列}&br;
等
終了行:
** emphasis.inc.php [#wdd83cf6]
|RIGHT:100|LEFT:360|c
|~サマリ|圏点表示|
|~リビジョン|1.01|
|~対応バージョン|1.5.x|
|~投稿者|[[M.Taniguchi]]|
|~投稿日|&new{2019-08-03 (土) 00:48:46};|
**概要 [#oba072a8]
文字列に圏点(傍点・脇点)を付加するプラグイン。&br;
CSS3の text-emphasis-style を利用するため、対応ブラウザー...
**使い方 [#rcb135cf]
-&emphasis(){文字列}
-&emphasis(圏点種別){文字列}
&br;''引数''
-文字列 … 圏点を付加したい文字列
-圏点種別 … [filled|open] [dot|circle|double-circle|trian...
&br;''使用例''
これは&emphasis(){強調文字列}です。
**コード [#m0f82c40]
emphasis.inc.php~
(下記のコードをコピーして、plugin ディレクトリに emphasi...
<?php
/*
PukiWiki - Yet another WikiWikiWeb clone.
emphasis.inc.php, v1.01 2019 M.Taniguchi
License: GPL v3 or (at your option) any later version
文字列に圏点(傍点・脇点)を付加するPukiWiki用プラグイン。
CSS3の text-emphasis-style を利用するため、対応ブラウザ...
使い方:
&emphasis(){文字列}
&emphasis(圏点種別){文字列}
引数:
文字列 … 圏点を付加したい文字列
圏点種別 … [filled|open] [dot|circle|double-circle|trian...
*/
define('PLUGIN_EMPHASIS_USAGE', '&emphasis([emphasis typ...
define('PLUGIN_EMPHASIS_CLASS', false); // style属性の代...
function plugin_emphasis_inline() {
$argNum = func_num_args();
if ($argNum <= 0) return PLUGIN_EMPHASIS_USAGE;
$emphasis = 'filled';
if ($argNum == 1) {
list($body) = func_get_args();
} else {
list($emphasis, $body) = func_get_args();
}
$body = strip_htmltag($body);
if ($body == '') return PLUGIN_EMPHASIS_USAGE;
$emphasis = strip_htmltag($emphasis);
if (PLUGIN_EMPHASIS_CLASS) {
$emphasis = str_replace(' ', '-', $emphasis);
$html = '<span class="emphasis-' . $emphasis . '">' . ...
} else {
$html = '<span style="-webkit-text-emphasis-style:' . ...
}
return $html;
}
?>
**ライセンス [#z5e38841]
GPL v3
**ユーザ定義ルール版 [#o76d05e7]
このプラグインを導入しなくても、default.ini.php の $line_...
プラグインを作ったあとで気づきました。
'EMPHASIS\(([^\(\)]*)\){([^}]*)}' => '<span style="-webk...
#br
''使い方''
EMPHASIS(filled){強調したい文字列}&br;
EMPHASIS(open sesame){強調したい文字列}&br;
等
ページ名: