Help:Extensions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
(Undo revision 30442 by Editor (Talk))
Line 1: Line 1:
mediawikiのExtension機能により独自実装されているextension一覧
+
The list oforiginal extensions implemented on the Metabolome.jp server.
  
<h2>変数Extension</h2>
+
==Variables==
;<h3><nowiki>[[</nowiki>MEDIAWIKIROOT]]</h3>:'''/mediawiki'''<br>DOCUMENT_ROOTからのmediawikiフォルダへのパスに置き換わる。
+
;<h3><nowiki>[[</nowiki>MEDIAWIKIROOT]]</h4>:'''/mediawiki'''<br>
 +
Path string from DOCUMENT_ROOT to the mediawiki folder
  
;<h3><nowiki>[[</nowiki>APPLETROOT]]</h3>:'''/mediawiki/applt'''<br>DOCUMENT_ROOTからアプレットが保存されているパスに置き換わる
+
;<h3><nowiki>[[</nowiki>APPLETROOT]]</h4>:'''/mediawiki/applet'''<br>
 +
Path string from DOCUMENT_ROOT to the applet folder
  
<h2>タグExtension</h2>
+
==Tags==
;<h3>&lt;wbr&gt;</h3>:HTMLの&lt;wbr&gt;をそのまま使用可能。
+
;<h4>&lt;wbr&gt;</h4>:Output &lt;wbr&gt; of HTML
  
;<h3>&lt;formula&gt;</h3>:タイトルからmolファイルを探し出し、存在した場合にmolファイル内に書かれている組成式データに置き換える。
+
;<h4>&lt;formula&gt;</h4>:Output formula of the MOL file corresponding to the page title
  
;<h3>&lt;ave_mass&gt;</h3>:タイトルからmolファイルを探し出し、存在した場合にmolファイル内に書かれている平均質量データに置き換える。
+
;<h4>&lt;ave_mass&gt;</h4>:Output average mass of the MOL file corresponding to the page title
  
;<h3>&lt;ext_mass&gt;</h3>:タイトルからmolファイルを探し出し、存在した場合にmolファイル内に書かれている精密質量データに置き換える。
+
;<h4>&lt;ext_mass&gt;</h4>:Output exact mass of the MOL file corresponding to the page title
  
;<h3>&lt;smiles&gt;</h3>:タイトルからmolファイルを探し出し、存在した場合にmolファイル内に書かれているSMILESデータに置き換える。
+
;<h4>&lt;smiles&gt;</h4>:Output SMILES of the MOL file corresponding to the page title
  
<h2>Parser Extension</h2>
+
==Parser Functions==
*デフォルト引数のない引数は必須
+
* Arguments without default values are required.
;<h3><nowiki>{{#substring:文字列|開始位置=0|終了位置=0}}</nowiki></h3>:与えられた文字列の部分文字列を返す。日本語対応。<br>e.g. <nowiki>{{#substring:Hello world|1}}</nowiki> => "{{#substring:Hello world|1}}"<br>e.g. <nowiki>{{#substring:Hello world|1|4}}</nowiki> => "{{#substring:Hello world|1|4}}"
+
  
;<h3><nowiki>{{#length:文字列}}</nowiki></h3>:与えられた文字列の長さを返す。日本語対応。<br>e.g. <nowiki>{{#length:Hello world}}</nowiki> => {{#length:Hello world}}
+
;<h4><nowiki>{{#substring:str|start=0|end=0}}</nowiki></h4>:Returns a substring. Japanese ok. <br>e.g. <nowiki>{{#substring:Hello world|1}}</nowiki> => "{{#substring:Hello world|1}}"<br>e.g. <nowiki>{{#substring:Hello world|1|4}}</nowiki> => "{{#substring:Hello world|1|4}}"
  
;<h3><nowiki>{{#indexOf:文字列|パターン文字列='&nbsp;'(半角スペース)|オフセット=0}}</nowiki></h3>:与えられた文字列から、最初にパターン文字列が現れるインデックスを返す。スペースを指定する場合は「&amp;#160;」を用いる。<br>e.g. <nowiki>{{#indexOf:Hello world|wor}}</nowiki> = {{#indexOf:Hello world|wor}}<br>e.g. <nowiki>{{#indexOf:Hello world}}</nowiki> = {{#indexOf:Hello world}}
+
;<h4><nowiki>{{#length:str}}</nowiki></h4>:Returns the length. Japanese ok.<br>e.g. <nowiki>{{#length:Hello world}}</nowiki> => {{#length:Hello world}}
  
;<h3><nowiki>{{#lastIndexOf:文字列|パターン文字列='&nbsp;'(半角スペース)}}</nowiki></h3>:与えられた文字列から、最後にパターン文字列が現れるインデックスを返す。スペースを指定する場合は「&amp;#160;」を用いる。<br>e.g. <nowiki>{{#lastIndexOf:abc abc abc|abc}}</nowiki> = {{#lastIndexOf:abc abc abc|abc}}<br>e.g. <nowiki>{{#lastIndexOf:abc abc abc}}</nowiki> = {{#lastIndexOf:abc abc abc}}
+
;<h4><nowiki>{{#indexOf:str|pattern='&nbsp;'(space)|offset=0}}</nowiki></h4>:Returns the first matching index of the pattern. To specify a space, use &amp;#160;.<br>e.g. <nowiki>{{#indexOf:Hello world|wor}}</nowiki> = {{#indexOf:Hello world|wor}}<br>e.g. <nowiki>{{#indexOf:Hello world}}</nowiki> = {{#indexOf:Hello world}}
  
;<h3><nowiki>{{#isdigit:文字列|処理1|処理2}}</nowiki></h3>:与えられた文字列が全て数字で構成されていれば処理1を、そうでなければ処理2を返す。<br>e.g. <nowiki>{{#isdigit:1234567890|This is digit|This is not digit}}</nowiki> => {{#isdigit:1234567890|This is digit|This is not digit}}<br>e.g. <nowiki>{{#isdigit:123abc456|This is not alphanumeric|This is alphanumeric}}</nowiki> => {{#isdigit:123abc456|This is not alphanumeric|This is alphanumeric}}
+
;<h4><nowiki>{{#lastIndexOf:str|pattern='&nbsp;'(space)}}</nowiki></h4>:Returns the last matching index of the pattern. To specify a space, use &amp;#160;.<br>e.g. <nowiki>{{#lastIndexOf:abc abc abc|abc}}</nowiki> = {{#lastIndexOf:abc abc abc|abc}}<br>e.g. <nowiki>{{#lastIndexOf:abc abc abc}}</nowiki> = {{#lastIndexOf:abc abc abc}}
  
;<h3><nowiki>{{#isalnum:文字列|処理1|処理2}}</nowiki></h3>:与えられた文字列が全て英数字で構成されていれば処理1を、そうでなければ処理2を返す。<br>e.g. <nowiki>{{#isalnum:123abc456|This is alphanumeric|This is not alphanumeric}}</nowiki> => {{#isalnum:123abc456|This is alphanumeric|This is not alphanumeric}}<br>e.g. <nowiki>{{#isalnum:*123abc456*|This is alphanumeric|This is not alphanumeric}}</nowiki> => {{#isalnum:*123abc456*|This is alphanumeric|This is not alphanumeric}}
+
;<h4><nowiki>{{#isdigit: str|yes|no}}</nowiki></h4>:Returns yes if str is digit, otherwise no.<br>e.g. <nowiki>{{#isdigit:1234567890|This is digit|This is not digit}}</nowiki> => {{#isdigit:1234567890|This is digit|This is not digit}}<br>e.g. <nowiki>{{#isdigit:123abc456|This is not alphanumeric|This is alphanumeric}}</nowiki> => {{#isdigit:123abc456|This is not alphanumeric|This is alphanumeric}}
  
;<h3><nowiki>{{#repeat:テンプレート名|引数の数|引数リスト|セパレータ="\n"|接頭辞=''|接尾辞=''}}</nowiki></h3>:与えられた引数リストをセパレータで分割し、指定されたテンプレートに引数の数だけ引数を渡し、引数がなくなるまでテンプレートを呼び出す。<br>ただし「|」はmediawiki内でのセパレータになっているので、引数リストやセパレータでは指定不可能。スペースを指定する場合は「&amp;#160;」を用いる。<br>e.g. <nowiki>{{#repeat:template|3|a,b,c,d,e,f,g,h,i|,}}</nowiki> => <nowiki>{{template|a|b|c}}{{template|d|e|f}}{{template|g|h|i}}</nowiki>
+
;<h4><nowiki>{{#isalnum:str|yes|no}}</nowiki></h4>:Returns yes if str is alphanumeric, otherwise no.<br>e.g. <nowiki>{{#isalnum:123abc456|This is alphanumeric|This is not alphanumeric}}</nowiki> => {{#isalnum:123abc456|This is alphanumeric|This is not alphanumeric}}<br>e.g. <nowiki>{{#isalnum:*123abc456*|This is alphanumeric|This is not alphanumeric}}</nowiki> => {{#isalnum:*123abc456*|This is alphanumeric|This is not alphanumeric}}
  
;<h3><nowiki>{{#cr:}}</nowiki></h3>:改行コードを返す。<br>e.g. <nowiki>{{#cr:}}</nowiki> => {{#cr:}}(改行)
+
;<h4><nowiki>{{#repeat:template|argc|argl|separator="\n"|prefix=''|postfix=''}}</nowiki></h4>:Repeatedly call the template of ''argc'' arguments until the argument list ''argl'' depletes.  The ''argl'' is separated by ''separator''. <br>To use a space for separator, use &amp;#160;. The vertical bar | cannot be used.<br>e.g. <nowiki>{{#repeat:template|3|a,b,c,d,e,f,g,h,i|,}}</nowiki> => <nowiki>{{template|a|b|c}}{{template|d|e|f}}{{template|g|h|i}}</nowiki>
  
;<h3><nowiki>{{#bar:}}</nowiki></h3>:「|」を返す。<br>e.g. <nowiki>{{#bar:}}</nowiki> => {{#bar:}}
+
;<h4><nowiki>{{#cr:}}</nowiki></h4>:Return code<br>e.g. <nowiki>{{#cr:}}</nowiki> => {{#cr:}}(return)
  
;<h3><nowiki>{{#count:文字列|パターン文字列}}</nowiki></h3>:パターン文字列が与えられた文字列の中に存在している回数を返す。日本語対応。<br>e.g. <nowiki>{{#count:abcabcabca|a}}</nowiki> => {{#count:abcabcabca|a}}
+
;<h4><nowiki>{{#bar:}}</nowiki></h4>:Vertical bar<br>e.g. <nowiki>{{#bar:}}</nowiki> => {{#bar:}}
  
;<h3><nowiki>{{#ifexistfile:パス}}</nowiki></h3>:DOCUMENT_ROOTから指定されたパスにファイルが存在している場合に、そのパスへのリンクを返す。<br>e.g. <nowiki>{{#ifexistfile:/index.html}}</nowiki> => {{#ifexistfile:/index.html}}
+
;<h4><nowiki>{{#count:str|pattern}}</nowiki></h4>:Returns the occurrence of pattern. Japanese ok. <br>e.g. <nowiki>{{#count:abcabcabca|a}}</nowiki> => {{#count:abcabcabca|a}}
  
;<h3><nowiki>{{#replace:文字列|パターン文字列|置換文字列}}</nowiki></h3>:与えられた文字列からパターン文字列にマッチする部分を置換文字列に置き換えて返す。スペースを指定する場合は「&#160;」を用いる。<br>e.g. <nowiki>{{#replace:abcdefghi|def|123}}</nowiki> => {{#replace:abcdefghi|def|123}}<br>e.g. <nowiki>{{#replace:a b c d|&amp;#160;|1}}</nowiki> => {{#replace:a b c d|&#160;|1}}
+
;<h4><nowiki>{{#ifexistfile:path}}</nowiki></h4>:Returns the link to the file which exists under path from DOCUMENT_ROOT<br>e.g. <nowiki>{{#ifexistfile:/index.html}}</nowiki> => {{#ifexistfile:/index.html}}
  
;<h3><nowiki>{{#javaWithParam:クラス名|アーカイブ名|コードベース=.|幅=100|高さ=100|パラメータ=''}}</nowiki></h3>:javaアプレットを表示するHTMLコードを返す。パラメータは「;」区切りで指定可能。<br>e.g. <nowiki>{{#javaWithParam:Main.class|Main.jar|.|100|100|data=123;id=java}}</nowiki> => <br><object codebase="." code="Main.class" archive="Main.jar" width="100" height="100"><br><param name="data" value="123"><br><param name="id" value="java"><br></object>
+
;<h4><nowiki>{{#replace:str|pattern1|pattern2}}</nowiki></h4>:Replace all occurrences of 'pattern1' into 'pattern2'. To specify a space, use &#160;.<br>e.g. <nowiki>{{#replace:abcdefghi|def|123}}</nowiki> => {{#replace:abcdefghi|def|123}}<br>e.g. <nowiki>{{#replace:a b c d|&amp;#160;|1}}</nowiki> => {{#replace:a b c d|&#160;|1}}
  
;<h3><nowiki>{{#searchLine:検索語|名前空間='Main'|ページタイトル=''}}</nowiki></h3>:与えられた検索語を指定された名前空間、ページから探しだしその結果を返す。ページタイトルまで指定すると検索範囲が狭められるので、処理効率が良い。<br>検索後は「^」を先頭につけることで文頭、「$」を末尾につけることで文末指定が可能。結果は頭に「&amp;&amp;ページ名」が付与される。<br>この検索はedit画面で見えるwikiコードに対して行われる。<br>e.g. <nowiki>{{#searchLine:sandbox|Main|Sandbox}}</nowiki> => {{#searchLine:sandbox|Main|Sandbox}}
+
;<h4><nowiki>{{#javaWithParam:classname|archive|codebase=.|width=100|height=100|parameter=''}}</nowiki></h4>:Returns HTML code to show the java applet. Parameters can be delimited by ';'.<br>e.g. <nowiki>{{#javaWithParam:Main.class|Main.jar|.|100|100|data=123;id=java}}</nowiki> => <br><object codebase="." code="Main.class" archive="Main.jar" width="100" height="100"><br><param name="data" value="123"><br><param name="id" value="java"><br></object>
  
;<h3><nowiki>{{#car:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcarをエミュレート。<br>e.g. <nowiki>{{#car:a;b;c;d;e|;}}</nowiki> => {{#car:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#searchLine: str |namespace='Main'|pagename=''}}</nowiki></h4>:Output all matching lines from page ''pagename'' in ''namespace''.<br>Line head and tail can be specified with ^ and $, respectively. Resulting lines has &amp;&amp;pagename at the beginning of the line.<br>The search is against the wiki source code in edit mode.<br>e.g. <nowiki>{{#searchLine:sandbox|Main|Sandbox}}</nowiki> => {{#searchLine:sandbox|Main|Sandbox}}
  
;<h3><nowiki>{{#cdr:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcdrをエミュレート。<br>e.g. <nowiki>{{#cdr:a;b;c;d;e|;}}</nowiki> => {{#cdr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#car:str|separator='&nbsp;'(space)}}</nowiki></h4>:car in Lisp<br>e.g. <nowiki>{{#car:a;b;c;d;e|;}}</nowiki> => {{#car:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#cadr:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcadrをエミュレート。<br>e.g. <nowiki>{{#cadr:a;b;c;d;e|;}}</nowiki> => {{#cadr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#cdr:str|separator='&nbsp;'(space)}}</nowiki></h4>:cdr in Lisp<br>e.g. <nowiki>{{#cdr:a;b;c;d;e|;}}</nowiki> => {{#cdr:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#cddr:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcddrをエミュレート。<br>e.g. <nowiki>{{#cddr:a;b;c;d;e|;}}</nowiki> => {{#cddr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#cadr:str|separator='&nbsp;'(space)}}</nowiki></h4>:cadr in Lisp<br>e.g. <nowiki>{{#cadr:a;b;c;d;e|;}}</nowiki> => {{#cadr:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#caddr:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcaddrをエミュレート。<br>e.g. <nowiki>{{#caddr:a;b;c;d;e|;}}</nowiki> => {{#caddr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#cddr:str|separator='&nbsp;'(space)}}</nowiki></h4>:cddr in Lisp<br>e.g. <nowiki>{{#cddr:a;b;c;d;e|;}}</nowiki> => {{#cddr:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#cdddr:文字列|セパレータ='&nbsp;'(半角スペース)}}</nowiki></h3>:Pascalのcdddrをエミュレート。<br>e.g. <nowiki>{{#cdddr:a;b;c;d;e|;}}</nowiki> => {{#cdddr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#caddr:str|separator='&nbsp;'(space)}}</nowiki></h4>:caddr in Lisp<br>e.g. <nowiki>{{#caddr:a;b;c;d;e|;}}</nowiki> => {{#caddr:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#trim:文字列}}</nowiki></h3>:与えられた文字列の前後の空白を削除した結果を返す。削除対象は「\n」「\r」「\t」「\v」「\0」。<br>e.g. <nowiki>{{#trim:abc(\n)}}</nowiki> => abc
+
;<h4><nowiki>{{#cdddr:str|separator='&nbsp;'(space)}}</nowiki></h4>:cdddr in Lisp<br>e.g. <nowiki>{{#cdddr:a;b;c;d;e|;}}</nowiki> => {{#cdddr:a;b;c;d;e|;}}
  
;<h3><nowiki>{{#post:ページ名|名前|引数|ボタン文字列='send'}}</nowiki></h3>:postを用いたHTMLのformコードを返す。<br>e.g. <nowiki>{{#post:WikiPage|data|abcdef}}</nowiki> =><br><nowiki><form action="[WIKI]/WikiPage" method="post"></nowiki><br><nowiki><input type="hidden" name="data" value="abcdef"></nowiki><br><nowiki><input type="submit" value="send"></nowiki><br><nowiki></form></nowiki>
+
;<h4><nowiki>{{#trim:str}}</nowiki></h4>:Remove white space before and after ''str''. (Deletes \n, \r, \t, \v, \0)<br>e.g. <nowiki>{{#trim:abc(\n)}}</nowiki> => abc
  
;<h3><nowiki>{{#get:名前}}</nowiki></h3>:getメソッド、postメソッドにより送信されたデータを返す。<br>e.g. <nowiki>{{#get:data}}</nowiki> => abcdef
+
;<h4><nowiki>{{#post:pagename|name|arg|button='send'}}</nowiki></h4>:Returns the HTML form code with post.<br>e.g. <nowiki>{{#post:WikiPage|data|abcdef}}</nowiki> =><br><nowiki><form action="[WIKI]/WikiPage" method="post"></nowiki><br><nowiki><input type="hidden" name="data" value="abcdef"></nowiki><br><nowiki><input type="submit" value="send"></nowiki><br><nowiki></form></nowiki>
  
;<h3><nowiki>{{#forcedBR:文字列|強制改行文字数=25}}</nowiki></h3>:与えられた文字列に強制改行文字列ごとに<nowiki><wbr></nowiki>を挟み込みます。<br>e.g. <nowiki>{{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}</nowiki> => {{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}
+
;<h4><nowiki>{{#get:name}}</nowiki></h4>:Returns the data sent by get/post.<br>e.g. <nowiki>{{#get:data}}</nowiki> => abcdef
  
;<h3><nowiki>{{#tag:タグ文字列|引数|タグで囲まれる文字列}}</nowiki></h3>:許可された特定のタグのみHTMLコードとして返す。許可されているタグは「form」「textare」「select」「option」「optgroup」「fieldset」「legend」「label」「input」。<br>formによるメソッド指定はpostのみ。<br>e.g. <nowiki>{{#tag:input|type="submit"}} => <input type="submit"></nowiki><br><nowiki>e.g. {{#tag:form|action="-"|...}} => <form action="-" method="post">...</form></nowiki>
+
;<h4><nowiki>{{#forcedBR:str|width=25}}</nowiki></h4>:Insert<nowiki><wbr></nowiki>every ''width'' characters.<br>e.g. <nowiki>{{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}</nowiki> => {{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}
  
;<h3><nowiki>{{#graph:グラフの種類|サイズ|データ|ラベル=''|タイトル=''}}</nowiki></h3>:jpgraphによるグラフ生成を行う。グラフの種類は「pie」「pie3d」「line」「hvar」「vbar」をサポート。サイズは「幅x高さ」で指定、データ、ラベルは「,」のリスト。<br>e.g. <nowiki>{{#graph:pie|100x100|12,34,21|ID1,ID2,ID3|Title}}</nowiki> =><br> {{#graph:pie|300x300|12,34,21|ID1,ID2,ID3|Title}}
+
;<h4><nowiki>{{#tag:str|arg|between}}</nowiki></h4>:Returns HTML tag with ''arg'', and with ''between'' string. It accepts only "form, textarea, select, option, optgroup, fieldset, legend, label, input".<br>The form can perform post method only.<br>e.g. <nowiki>{{#tag:input|type="submit"}} => <input type="submit"></nowiki><br><nowiki>e.g. {{#tag:form|action="-"|...}} => <form action="-" method="post">...</form></nowiki>
  
;<h3><nowiki>{{#def:変数名|}}</nowiki></h3>:そのページのみで使用可能な変数を定義する。<br>e.g. <nowiki>{{#def:i|1}}</nowiki> => i=1
+
;<h4><nowiki>{{#graph:type|size|data|label=''|title=''}}</nowiki></h4>:Generate graph by jpgraph. The ''type'' can be pie, pie3d, line, hvar, vbar.  Size is specified by widthxheight. ''Data'' and ''label'' are separated by ','.<br>e.g. <nowiki>{{#graph:pie|100x100|12,34,21|ID1,ID2,ID3|Title}}</nowiki> =><br> {{#graph:pie|300x300|12,34,21|ID1,ID2,ID3|Title}}
  
;<h3><nowiki>{{#var:変数名}}</nowiki></h3>:変数の中身を返す。<br>e.g. <nowiki>{{#var:i}}</nowiki> => 1
+
;<h4><nowiki>{{#def:arg|val}}</nowiki></h4>:Define a variable valid only inside the page.<br>e.g. <nowiki>{{#def:i|1}}</nowiki> => i=1
  
;<h3><nowiki>{{#and:リスト1|リスト2}}</nowiki></h3>:改行区切りで与えられた二つのリストの中で、両方に存在している行のみ返す。<br>e.g. <br><nowiki>{{#</nowiki>and:1<br>2<br>4|1<br>3<br>4}} => 1 4
+
;<h4><nowiki>{{#var:arg}}</nowiki></h4>:Get variable value<br>e.g. <nowiki>{{#var:i}}</nowiki> => 1
  
;<h3><nowiki>{{#or:リスト1|リスト2}}</nowiki></h3>:改行区切りで与えられた二つのリストをあわせた結果を返す。<br>e.g. <br><nowiki>{{#</nowiki>or:1<br>2<br>4|1<br>3<br>4}} => 1 2 3 4
+
;<h4><nowiki>{{#and:list1|list2}}</nowiki></h4>:Returns intersection of two (return-code separated) lists.<br>e.g. <br><nowiki>{{#</nowiki>and:1<br>2<br>4|1<br>3<br>4}} => 1 4
  
;<h3><nowiki>{{#lua:ソース|引数}}</nowiki></h3>:luaプログラムを実行する。引数に与えたデータは「stdin」という変数名でアクセス可能。ただし、io、debug、package、osクラスは使用不可能。<br>e.g. <nowiki>{{#lua:print(stdin)|abc}}</nowiki> => {{#lua:print(stdin)|abc}}
+
;<h4><nowiki>{{#or:list1|list2}}</nowiki></h4>:Returns union of two (return-code separated) lists.<br>e.g. <br><nowiki>{{#</nowiki>or:1<br>2<br>4|1<br>3<br>4}} => 1 2 3 4
 +
 
 +
;<h4><nowiki>{{#lua:program|arg}}</nowiki></h4>:Execute lua program. Arg is accessible with stdin. No io, debug, package, os classes.<br>e.g. <nowiki>{{#lua:print(stdin)|abc}}</nowiki> => {{#lua:print(stdin)|abc}}
  
 
<h2>SpecialPage</h2>
 
<h2>SpecialPage</h2>
;<h3>ReferenceIndexes</h3>:名前空間:Referenceを対象にしたドキュメント名、著者名によるインデックス一覧<br>[[Special:ReferenceIndexes]]
+
;<h4>ReferenceIndexes</h4>:Generate index of namespace:Reference<br>[[Special:ReferenceIndexes]]
  
<h2>その他のExtension</h2>
+
==Others==
;<h3>検索</h3>:左側の検索部の拡張。
+
;<h4>Search</h4>: Modification of search function
*大文字小文字の区別はしない。
+
* case independent
*「_」による任意の一文字とマッチ
+
* '_' matches any letter
*%」による0文字以上の全ての文字とマッチ
+
* '%' matches any string
  
<h2>importされた既存Extension</h2>
+
==Imported Extensions==
;<h3>CategoryTree</h3>:[http://www.mediawiki.org/wiki/Extension:CategoryTree CategoryTree Extension]
+
;<h4>CategoryTree</h4>:[http://www.mediawiki.org/wiki/Extension:CategoryTree CategoryTree Extension]
  
;<h3>Cite</h3>:[http://www.mediawiki.org/wiki/Extension:Cite Cite Extension]<br>[http://www.mediawiki.org/wiki/Extension:Cite/Cite.php#Usage Help1]<br>[http://www.mediawiki.org/wiki/Extension:Cite/Special:Cite.php#Example Help2]
+
;<h4>Cite</h4>:[http://www.mediawiki.org/wiki/Extension:Cite Cite Extension]<br>[http://www.mediawiki.org/wiki/Extension:Cite/Cite.php#Usage Help1]<br>[http://www.mediawiki.org/wiki/Extension:Cite/Special:Cite.php#Example Help2]
  
;<h3>ParserFunctions</h3>:[http://www.mediawiki.org/wiki/Extension:ParserFunctions ParserFunctions Extension]<br>[http://meta.wikimedia.org/wiki/Help:ParserFunctions Help]
+
;<h4>ParserFunctions</h4>:[http://www.mediawiki.org/wiki/Extension:ParserFunctions ParserFunctions Extension]<br>[http://meta.wikimedia.org/wiki/Help:ParserFunctions Help]

Revision as of 13:18, 28 February 2008

The list oforiginal extensions implemented on the Metabolome.jp server.

Contents

Variables

[[MEDIAWIKIROOT]]</h4>:/mediawiki

Path string from DOCUMENT_ROOT to the mediawiki folder

<h3>[[APPLETROOT]]</h4>
/mediawiki/applet

Path string from DOCUMENT_ROOT to the applet folder

Tags

<wbr>

Output <wbr> of HTML

<formula>

Output formula of the MOL file corresponding to the page title

<ave_mass>

Output average mass of the MOL file corresponding to the page title

<ext_mass>

Output exact mass of the MOL file corresponding to the page title

<smiles>

Output SMILES of the MOL file corresponding to the page title

Parser Functions

  • Arguments without default values are required.

{{#substring:str|start=0|end=0}}

Returns a substring. Japanese ok.
e.g. {{#substring:Hello world|1}} => "ello world"
e.g. {{#substring:Hello world|1|4}} => "ell"

{{#length:str}}

Returns the length. Japanese ok.
e.g. {{#length:Hello world}} => 11

{{#indexOf:str|pattern=' '(space)|offset=0}}

Returns the first matching index of the pattern. To specify a space, use &#160;.
e.g. {{#indexOf:Hello world|wor}} = 6
e.g. {{#indexOf:Hello world}} = 5

{{#lastIndexOf:str|pattern=' '(space)}}

Returns the last matching index of the pattern. To specify a space, use &#160;.
e.g. {{#lastIndexOf:abc abc abc|abc}} = 8
e.g. {{#lastIndexOf:abc abc abc}} = 7

{{#isdigit: str|yes|no}}

Returns yes if str is digit, otherwise no.
e.g. {{#isdigit:1234567890|This is digit|This is not digit}} => This is digit
e.g. {{#isdigit:123abc456|This is not alphanumeric|This is alphanumeric}} => This is alphanumeric

{{#isalnum:str|yes|no}}

Returns yes if str is alphanumeric, otherwise no.
e.g. {{#isalnum:123abc456|This is alphanumeric|This is not alphanumeric}} => This is alphanumeric
e.g. {{#isalnum:*123abc456*|This is alphanumeric|This is not alphanumeric}} => This is not alphanumeric

{{#repeat:template|argc|argl|separator="\n"|prefix=''|postfix=''}}

Repeatedly call the template of argc arguments until the argument list argl depletes. The argl is separated by separator.
To use a space for separator, use &#160;. The vertical bar | cannot be used.
e.g. {{#repeat:template|3|a,b,c,d,e,f,g,h,i|,}} => {{template|a|b|c}}{{template|d|e|f}}{{template|g|h|i}}

{{#cr:}}

Return code
e.g. {{#cr:}} =>

(return)

{{#bar:}}

Vertical bar
e.g. {{#bar:}} => |

{{#count:str|pattern}}

Returns the occurrence of pattern. Japanese ok.
e.g. {{#count:abcabcabca|a}} => 4

{{#ifexistfile:path}}

Returns the link to the file which exists under path from DOCUMENT_ROOT
e.g. {{#ifexistfile:/index.html}} => index.html

{{#replace:str|pattern1|pattern2}}

Replace all occurrences of 'pattern1' into 'pattern2'. To specify a space, use  .
e.g. {{#replace:abcdefghi|def|123}} => abc123ghi
e.g. {{#replace:a b c d|&#160;|1}} => a1b1c1d

{{#javaWithParam:classname|archive|codebase=.|width=100|height=100|parameter=''}}

Returns HTML code to show the java applet. Parameters can be delimited by ';'.
e.g. {{#javaWithParam:Main.class|Main.jar|.|100|100|data=123;id=java}} =>
<object codebase="." code="Main.class" archive="Main.jar" width="100" height="100">
<param name="data" value="123">
<param name="id" value="java">
</object>

{{#searchLine: str |namespace='Main'|pagename=''}}

Output all matching lines from page pagename in namespace.
Line head and tail can be specified with ^ and $, respectively. Resulting lines has &&pagename at the beginning of the line.
The search is against the wiki source code in edit mode.
e.g. {{#searchLine:sandbox|Main|Sandbox}} =>

{{#car:str|separator=' '(space)}}

car in Lisp
e.g. {{#car:a;b;c;d;e|;}} => a

{{#cdr:str|separator=' '(space)}}

cdr in Lisp
e.g. {{#cdr:a;b;c;d;e|;}} => b;c;d;e

{{#cadr:str|separator=' '(space)}}

cadr in Lisp
e.g. {{#cadr:a;b;c;d;e|;}} => b

{{#cddr:str|separator=' '(space)}}

cddr in Lisp
e.g. {{#cddr:a;b;c;d;e|;}} => c;d;e

{{#caddr:str|separator=' '(space)}}

caddr in Lisp
e.g. {{#caddr:a;b;c;d;e|;}} => c

{{#cdddr:str|separator=' '(space)}}

cdddr in Lisp
e.g. {{#cdddr:a;b;c;d;e|;}} => d;e

{{#trim:str}}

Remove white space before and after str. (Deletes \n, \r, \t, \v, \0)
e.g. {{#trim:abc(\n)}} => abc

{{#post:pagename|name|arg|button='send'}}

Returns the HTML form code with post.
e.g. {{#post:WikiPage|data|abcdef}} =>
<form action="[WIKI]/WikiPage" method="post">
<input type="hidden" name="data" value="abcdef">
<input type="submit" value="send">
</form>

{{#get:name}}

Returns the data sent by get/post.
e.g. {{#get:data}} => abcdef

{{#forcedBR:str|width=25}}

Insert<wbr>every width characters.
e.g. {{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}} => 123456789012345678901234567890123456789012345678901234567890

{{#tag:str|arg|between}}

Returns HTML tag with arg, and with between string. It accepts only "form, textarea, select, option, optgroup, fieldset, legend, label, input".
The form can perform post method only.
e.g. {{#tag:input|type="submit"}} => <input type="submit">
e.g. {{#tag:form|action="-"|...}} => <form action="-" method="post">...</form>

{{#graph:type|size|data|label=''|title=''}}

Generate graph by jpgraph. The type can be pie, pie3d, line, hvar, vbar. Size is specified by widthxheight. Data and label are separated by ','.
e.g. {{#graph:pie|100x100|12,34,21|ID1,ID2,ID3|Title}} =>

{{#def:arg|val}}

Define a variable valid only inside the page.
e.g. {{#def:i|1}} => i=1

{{#var:arg}}

Get variable value
e.g. {{#var:i}} => 1

{{#and:list1|list2}}

Returns intersection of two (return-code separated) lists.
e.g.
{{#and:1
2
4|1
3
4}} => 1 4

{{#or:list1|list2}}

Returns union of two (return-code separated) lists.
e.g.
{{#or:1
2
4|1
3
4}} => 1 2 3 4

{{#lua:program|arg}}

Execute lua program. Arg is accessible with stdin. No io, debug, package, os classes.
e.g. {{#lua:print(stdin)|abc}} => abc


SpecialPage

ReferenceIndexes

Generate index of namespace:Reference
Special:ReferenceIndexes

Others

Search

Modification of search function
  • case independent
  • '_' matches any letter
  • '%' matches any string

Imported Extensions

CategoryTree

CategoryTree Extension

Cite

Cite Extension
Help1
Help2

ParserFunctions

ParserFunctions Extension
Help
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox