Help:Extensions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
 
(64 intermediate revisions by 3 users not shown)
Line 1: Line 1:
List of supported extensions using the MediaWiki's extension function
+
The list of original commands implemented on the Metabolomics.jp server.
<h2>Variable Extension</h2>
+
;<h3><nowiki>[[</nowiki>MEDIAWIKIROOT]]</h3>:'''/mediawiki'''<br>The path to the MediaWiki folder from the DOCUMENT_ROOT
+
  
;<h3><nowiki>[[</nowiki>APPLETROOT]]</h3>:'''/mediawiki/applt'''<br>The path to the applet folder from the DOCUMENT_ROOT
+
<!--
 +
==Variables==
 +
;<h4><nowiki>[[</nowiki>MEDIAWIKIROOT]]</h4>:'''/mediawiki'''<br>
 +
Path string from DOCUMENT_ROOT to the mediawiki folder
  
<h2>Tag Extension</h2>
+
;<h4><nowiki>[[</nowiki>APPLETROOT]]</h4>:'''/mediawiki/applet'''<br>
;<h3>&lt;wbr&gt;</h3>:Use &lt;wbr&gt; of HTML as they are
+
Path string from DOCUMENT_ROOT to the applet folder
 +
-->
  
;<h3>&lt;formula&gt;</h3>:Find the corresponding MOL file from the page title, and output its formula data.
+
==Tags==
 +
;<h4>&lt;wbr&gt;</h4>:Output &lt;wbr&gt; of HTML
 +
<!--
 +
;<h4>&lt;formula&gt;</h4>:Output formula of the MOL file corresponding to the page title
  
;<h3>&lt;ave_mass&gt;</h3>:Find the corresponding MOL file from the page title, and output its average mass data.
+
;<h4>&lt;ave_mass&gt;</h4>:Output average mass of the MOL file corresponding to the page title
  
;<h3>&lt;ext_mass&gt;</h3>:Find the corresponding MOL file from the page title, and output its exact mass data.
+
;<h4>&lt;ext_mass&gt;</h4>:Output exact mass of the MOL file corresponding to the page title
  
;<h3>&lt;smiles&gt;</h3>:Find the corresponding MOL file from the page title, and output its SMILES data.
+
;<h4>&lt;smiles&gt;</h4>:Output SMILES of the MOL file corresponding to the page title
 +
-->
 +
==Parser Functions==
 +
* Arguments written without default values are required.
  
<h2>Parser Extension</h2>
+
===data structure===
*Arguments without default values (= arg) are required.
+
  
;<h3><nowiki>{{#substring: str | start=0 | end=0 }}</nowiki></h3>:Returns 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}}"
+
;<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>{{#length: str }}</nowiki></h3>:Returns string length. Japanese ok.<br>e.g. <nowiki>{{#length:Hello world}}</nowiki> => {{#length:Hello world}}
+
;<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>{{#indexOf: str | pattern ='&nbsp;'(space)|offset=0}}</nowiki></h3>:Returns the first index where the pattern occurs. 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}}
+
;<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>{{#lastIndexOf: str | pattern ='&nbsp;'(space)}}</nowiki></h3>:Returns the last index where the pattern occurs. To spacify 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}}
+
;<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>{{#isdigit: str | yes | no }}</nowiki></h3>: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}}
+
;<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>{{#isalnum: str | yes | no }}</nowiki></h3>: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}}
+
;<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>{{#repeat: template | argc | args |separator="\n"|prefix=''|postfix=''}}</nowiki></h3>:—^‚¦‚ç‚ꂽˆø”ƒŠƒXƒg‚ðƒZƒpƒŒ[ƒ^‚Å•ªŠ„‚µAŽw’肳‚ꂽƒeƒ“ƒvƒŒ[ƒg‚Ɉø”‚̐”‚¾‚¯ˆø”‚ð“n‚µAˆø”‚ª‚È‚­‚È‚é‚܂Ńeƒ“ƒvƒŒ[ƒg‚ðŒÄ‚яo‚·B<br>‚½‚¾‚µu|v‚Ímediawiki“à‚ł̃ZƒpƒŒ[ƒ^‚É‚È‚Á‚Ä‚¢‚é‚̂ŁAˆø”ƒŠƒXƒg‚âƒZƒpƒŒ[ƒ^‚Å‚ÍŽw’è•s‰Â”\BƒXƒy[ƒX‚ðŽw’è‚·‚éê‡‚́u&amp;#160;v‚ð—p‚¢‚éB<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>{{#nth:str| num |separator='&nbsp;'(space)}}</nowiki></h4>:nth in Lisp<br>e.g. <nowiki>{{#nth:a;b;c;d;e|3|;}}</nowiki> => {{#nth:a;b;c;d;e|3|;}}
  
;<h3><nowiki>{{#cr:}}</nowiki></h3>:Returns \cr.<br>e.g. <nowiki>{{#cr:}}</nowiki> => {{#cr:}}(‰üs)
+
;<h4><nowiki>{{#max:num1|num2|...|numN}}</nowiki></h4>:一番大きな値を返します。数字以外が入っていた場合は-1を返します。<br>e.g. <nowiki>{{#max:5|10|2|24|4|1|12}}</nowiki> => {{#max:5|10|2|24|4|0|12}}
  
;<h3><nowiki>{{#bar:}}</nowiki></h3>:Returns |.<br>e.g. <nowiki>{{#bar:}}</nowiki> => {{#bar:}}
+
;<h4><nowiki>{{#min:num1|num2|...|numN}}</nowiki></h4>:一番小さな値を返します。数字以外が入っていた場合は-1を返します。<br>e.g. <nowiki>{{#min:5|10|2|24|4|1|12}}</nowiki> => {{#min:5|10|2|24|4|0|12}}
  
;<h3><nowiki>{{#count: str | pattern }}</nowiki></h3>:Returns the count of pattern in the str. Japanese ok.<br>e.g. <nowiki>{{#count:abcabcabca|a}}</nowiki> => {{#count:abcabcabca|a}}
+
;<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>{{#ifexistfile:ƒpƒX}}</nowiki></h3>:DOCUMENT_ROOT‚©‚çŽw’肳‚ꂽƒpƒX‚Ƀtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ä‚¢‚éê‡‚ɁA‚»‚̃pƒX‚ւ̃Šƒ“ƒN‚ð•Ô‚·B<br>e.g. <nowiki>{{#ifexistfile:/index.html}}</nowiki> => {{#ifexistfile:/index.html}}
+
;<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
  
;<h3><nowiki>{{#replace: str |pattern |’uŠ· str }}</nowiki></h3>:—^‚¦‚ç‚ꂽ str ‚©‚çpattern ‚Ƀ}ƒbƒ`‚·‚é•”•ª‚ð’uŠ· str ‚É’u‚«Š·‚¦‚Ä•Ô‚·BƒXƒy[ƒX‚ðŽw’è‚·‚éê‡‚́u&#160;v‚ð—p‚¢‚éB<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>{{#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>{{#javaWithParam:ƒNƒ‰ƒX–¼|ƒA[ƒJƒCƒu–¼|ƒR[ƒhƒx[ƒX=.|•=100|‚‚³=100|ƒpƒ‰ƒ[ƒ^=''}}</nowiki></h3>:javaƒAƒvƒŒƒbƒg‚ð•\Ž¦‚·‚éHTMLƒR[ƒh‚ð•Ô‚·Bƒpƒ‰ƒ[ƒ^‚́u;v‹æØ‚è‚ÅŽw’è‰Â”\B<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>{{#var:arg}}</nowiki></h4>:Get variable value<br>e.g. <nowiki>{{#var:i}}</nowiki> => 1
  
;<h3><nowiki>{{#searchLine:ŒŸõŒê|–¼‘O‹óŠÔ='Main'|ƒy[ƒWƒ^ƒCƒgƒ‹=''}}</nowiki></h3>:—^‚¦‚ç‚ꂽŒŸõŒê‚ðŽw’肳‚ꂽ–¼‘O‹óŠÔAƒy[ƒW‚©‚ç’T‚µ‚¾‚µ‚»‚ÌŒ‹‰Ê‚ð•Ô‚·Bƒy[ƒWƒ^ƒCƒgƒ‹‚Ü‚ÅŽw’è‚·‚é‚ÆŒŸõ”͈͂ª‹·‚ß‚ç‚ê‚é‚̂ŁAˆ—Œø—¦‚ª—Ç‚¢B<br>ŒŸõŒã‚́u^v‚ðæ“ª‚ɂ‚¯‚邱‚Æ‚Å•¶“ªAu$v‚ð––”ö‚ɂ‚¯‚邱‚Æ‚Å•¶––Žw’肪‰Â”\BŒ‹‰Ê‚Í“ª‚Ɂu&amp;&amp;ƒy[ƒW–¼v‚ª•t—^‚³‚ê‚éB<br>‚±‚ÌŒŸõ‚Íedit‰æ–Ê‚ÅŒ©‚¦‚éwikiƒR[ƒh‚ɑ΂µ‚čs‚í‚ê‚éB<br>e.g. <nowiki>{{#searchLine:sandbox|Main|Sandbox}}</nowiki> => {{#searchLine:sandbox|Main|Sandbox}}
+
;<h4><nowiki>{{#choose:line1 \n line2 \n lin3...|string}}</nowiki></h4>:最初の引数から、stringにマッチする行だけを返します.<br>e.g. <nowiki>{{#</nowiki>choose:abc1<br>def2<br>1234<nowiki>|1}}</nowiki> => {{#choose:abc1
 +
def2
 +
1234|1}}
  
;<h3><nowiki>{{#car: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate car in Lisp.<br>e.g. <nowiki>{{#car:a;b;c;d;e|;}}</nowiki> => {{#car:a;b;c;d;e|;}}
+
===string functions===
 +
;<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>{{#cdr: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate cdr in Lisp.<br>e.g. <nowiki>{{#cdr:a;b;c;d;e|;}}</nowiki> => {{#cdr:a;b;c;d;e|;}}
+
;<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> => {{#trim:abc
 +
}}
  
;<h3><nowiki>{{#cadr: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate cadr in Lisp.<br>e.g. <nowiki>{{#cadr:a;b;c;d;e|;}}</nowiki> => {{#cadr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#trimex:str}}</nowiki></h4>:str中のタブと改行を全て削除します。<br>e.g. <nowiki>{{#trimex:a bc def(\n)}}</nowiki> => {{#trimex:a bc def
 +
}}
  
;<h3><nowiki>{{#cddr: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate cddr in Lisp.<br>e.g. <nowiki>{{#cddr:a;b;c;d;e|;}}</nowiki> => {{#cddr:a;b;c;d;e|;}}
+
;<h4><nowiki>{{#length:str}}</nowiki></h4>:Returns the length. Japanese ok.<br>e.g. <nowiki>{{#length:Hello world}}</nowiki> => {{#length:Hello world}}
  
;<h3><nowiki>{{#caddr: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate caddr in Lisp.<br>e.g. <nowiki>{{#caddr:a;b;c;d;e|;}}</nowiki> => {{#caddr:a;b;c;d;e|;}}
+
;<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>{{#cdddr: str |delimiter='&nbsp;'(space)}}</nowiki></h3>:Emulate cdddr in Lisp.<br>e.g. <nowiki>{{#cdddr:a;b;c;d;e|;}}</nowiki> => {{#cdddr:a;b;c;d;e|;}}
+
;<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>{{#trim: str }}</nowiki></h3>:Emulate trim in Perl. Removes \n, \r, \t, \v, \0.<br>e.g. <nowiki>{{#trim:abc(\n)}}</nowiki> => abc
+
;<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>{{#post:page_title|name|arg|button_str ='send'}}</nowiki></h3>:Returns the form code in HTML 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>
+
;<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>{{#get:–¼‘O}}</nowiki></h3>:Returns data sent by get or post methods.<br>e.g. <nowiki>{{#get:data}}</nowiki> => abcdef
+
;<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>{{#forcedBR: str |‹­§‰üs•¶Žš”=25}}</nowiki></h3>:—^‚¦‚ç‚ꂽ str ‚É‹­§‰üs str ‚²‚Æ‚É<nowiki><wbr></nowiki>‚ð‹²‚Ýž‚Ý‚Ü‚·B<br>e.g. <nowiki>{{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}</nowiki> => {{#forcedBR:123456789012345678901234567890123456789012345678901234567890|10}}
+
;<h4><nowiki>{{#replace:str|pattern1|pattern2}}</nowiki></h4>:Replace all occurrences of 'pattern1' into 'pattern2'. To specify a space and vertical bar, use & #160; and & #124;, respectively.<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>{{#tag:ƒ^ƒO str |ˆø”|ƒ^ƒO‚ň͂܂ê‚é str }}</nowiki></h3>:‹–‰Â‚³‚ꂽ“Á’è‚̃^ƒO‚Ì‚ÝHTMLƒR[ƒh‚Æ‚µ‚Ä•Ô‚·B‹–‰Â‚³‚ê‚Ä‚¢‚éƒ^ƒO‚́uformvutextarevuselectvuoptionvuoptgroupvufieldsetvulegendvulabelvuinputvB<br>form‚É‚æ‚郁ƒ\ƒbƒhŽw’è‚Ípost‚̂݁B<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>{{#graph:ƒOƒ‰ƒt‚ÌŽí—Þ|ƒTƒCƒY|ƒf[ƒ^|ƒ‰ƒxƒ‹=''|ƒ^ƒCƒgƒ‹=''}}</nowiki></h3>:jpgraph‚É‚æ‚éƒOƒ‰ƒt¶¬‚ðs‚¤BƒOƒ‰ƒt‚ÌŽí—ނ́upievupie3dvulinevuhvarvuvbarv‚ðƒTƒ|[ƒgBƒTƒCƒY‚́u•x‚‚³v‚ÅŽw’èAƒf[ƒ^Aƒ‰ƒxƒ‹‚́u,v‚̃ŠƒXƒgB<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>{{#cr:}}</nowiki></h4>:Return code<br>e.g. <nowiki>{{#cr:}}</nowiki> => {{#cr:}}(return)
  
;<h3><nowiki>{{#def:•Ï”–¼|’l}}</nowiki></h3>:‚»‚̃y[ƒW‚Ì‚Ý‚ÅŽg—p‰Â”\‚ȕϐ”‚ð’è‹`‚·‚éB<br>e.g. <nowiki>{{#def:i|1}}</nowiki> => i=1
+
;<h4><nowiki>{{#bar:}}</nowiki></h4>:Vertical bar<br>e.g. <nowiki>{{#bar:}}</nowiki> => {{#bar:}}
  
;<h3><nowiki>{{#var:•Ï”–¼}}</nowiki></h3>:•Ï”‚Ì’†g‚ð•Ô‚·B<br>e.g. <nowiki>{{#var:i}}</nowiki> => 1
+
;<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>{{#and:ƒŠƒXƒg1|ƒŠƒXƒg2}}</nowiki></h3>:‰üs‹æØ‚è‚Å—^‚¦‚ç‚ꂽ“ñ‚‚̃ŠƒXƒg‚Ì’†‚ŁA—¼•û‚É‘¶Ý‚µ‚Ä‚¢‚és‚Ì‚Ý•Ô‚·B<br>e.g. <br><nowiki>{{#</nowiki>and:1<br>2<br>4|1<br>3<br>4}} => 1 4
+
;<h4><nowiki>{{#encode:str}}</nowiki></h4>:渡された文字列内の記号を%と二桁の数値に変換します。<br>e.g. <nowiki>{{#encode:a%b#c!d=e}}</nowiki> => {{#encode:a%b#c!d=e}}
  
;<h3><nowiki>{{#or:ƒŠƒXƒg1|ƒŠƒXƒg2}}</nowiki></h3>:‰üs‹æØ‚è‚Å—^‚¦‚ç‚ꂽ“ñ‚‚̃ŠƒXƒg‚ð‚ ‚í‚¹‚½Œ‹‰Ê‚ð•Ô‚·B<br>e.g. <br><nowiki>{{#</nowiki>or:1<br>2<br>4|1<br>3<br>4}} => 1 2 3 4
+
;<h4><nowiki>{{#decode:str}}</nowiki></h4>:{{#encode:}}で変換された文字列を元に戻します。<br>e.g. <nowiki>{{#decode:%61%25%62%23%63%21%64%3D%65}}</nowiki> => {{#decode:%61%25%62%23%63%21%64%3D%65}}
  
;<h3><nowiki>{{#lua:ƒ\[ƒX|ˆø”}}</nowiki></h3>:luaƒvƒƒOƒ‰ƒ€‚ðŽÀs‚·‚éBˆø”‚É—^‚¦‚½ƒf[ƒ^‚́ustdinv‚Æ‚¢‚¤•Ï”–¼‚ŃAƒNƒZƒX‰Â”\B‚½‚¾‚µAioAdebugApackageAosƒNƒ‰ƒX‚ÍŽg—p•s‰Â”\B<br>e.g. <nowiki>{{#lua:print(stdin)|abc}}</nowiki> => {{#lua:print(stdin)|abc}}
+
;<h4><nowiki>{{#createstring:str|num}}</nowiki></h4>:strをnum回 繰り返した文字列を返します。<br>e.g. <nowiki>{{#createstring:abc|3}}</nowiki> => {{#createstring:abc|3}}
  
<h2>SpecialPage</h2>
+
;<h4><nowiki>{{#upcase:str}}</nowiki></h4>:strを全て大文字に変えます。<br>e.g. <nowiki>{{#upcase:abc}}</nowiki> => {{#upcase:abc}}
;<h3>ReferenceIndexes</h3>:–¼‘O‹óŠÔ:Reference‚ð‘Ώۂɂµ‚½ƒhƒLƒ…ƒƒ“ƒg–¼A’˜ŽÒ–¼‚É‚æ‚éƒCƒ“ƒfƒbƒNƒXˆê——<br>[[Special:ReferenceIndexes]]
+
  
<h2>‚»‚Ì‘¼‚ÌExtension</h2>
+
;<h4><nowiki>{{#downcase:str}}</nowiki></h4>:strを全て小文字に変えます。<br>e.g. <nowiki>{{#downcase:ABC}}</nowiki> => {{#downcase:ABC}}
;<h3>ŒŸõ</h3>:¶‘¤‚ÌŒŸõ•”‚ÌŠg’£B
+
*‘啶Žš¬•¶Žš‚Ì‹æ•Ê‚Í‚µ‚È‚¢B
+
*u_v‚É‚æ‚é”CˆÓ‚̈ꕶŽš‚ƃ}ƒbƒ`
+
*u%v‚É‚æ‚é0•¶ŽšˆÈã‚Ì‘S‚Ä‚Ì•¶Žš‚ƃ}ƒbƒ`
+
  
<h2>import‚³‚ꂽŠù‘¶Extension</h2>
 
;<h3>CategoryTree</h3>:[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]
+
===flow and IO controls===
  
;<h3>ParserFunctions</h3>:[http://www.mediawiki.org/wiki/Extension:ParserFunctions ParserFunctions Extension]<br>[http://meta.wikimedia.org/wiki/Help:ParserFunctions Help]
+
;<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>
 +
 
 +
;<h4><nowiki>{{#repeatnum:template|argc|argl|separator="\n"}}</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><nowiki>{{#repeat:}}</nowiki>との相違点は、展開時にテンプレート引数の頭に「n=」と番号付けされること。<br>e.g. <nowiki>{{#repeatnum:template|3|a,b,c,d,e,f,g,h,i|,}}</nowiki> => <nowiki>{{template|1=a|2=b|3=c}}{{template|1=d|2=e|3=f}}{{template|1=g|2=h|3=i}}</nowiki>
 +
 
 +
;<h4><nowiki>{{#map:template|argc|argv1|argv2|...|argvN}}</nowiki></h4>:repeatと同じ機能ですが、こちらは引数を'|'区切りで渡します。<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>{{#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}}
 +
 
 +
;<h4><nowiki>{{#ifexists:page}}</nowiki></h4>:Checks whether the specified page exists. Different from the original 'ifexist' command, it does not check the visible contents in the page.<br>e.g. <nowiki>{{#ifexists:Image:KOX00002.png|true|false}}</nowiki> => {{#ifexists:Image:KOX00002.png|true|false}}
 +
 
 +
;<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>
 +
 
 +
;<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}}
 +
 
 +
<!--;<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>-->
 +
 
 +
;<h4><nowiki>{{#get:name}}</nowiki></h4>:Returns the data sent by get/post.<br>e.g. <nowiki>{{#get:data}}</nowiki> => abcdef
 +
 
 +
;<h4><nowiki>{{#formtag: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>{{#formtag:input|type="submit"}} => <input type="submit"></nowiki><br><nowiki>e.g. {{#formtag:form|action="-"|...}} => <form action="-" method="post">...</form></nowiki>
 +
<nowiki>2008/12/4 {{#tag:}}から{{#formtag:}}に変更しました。</nowiki>
 +
 
 +
;<h4><nowiki>{{#graph:type|size=[Width]x[Height];margin=[left=40],[right=20],[top=40],[bottom=40];title=[title];legend=[Left]x[Top];label=[label1],[label2],...;[data1]=[n1-1],[n1-2],...;[data2]=[n2-1],[n2-2],...;...}}</nowiki></h4>
 +
 
 +
Generate graph by jpgraph.
 +
;''type'' : pie, pie3d, line, hvar, hgbar, vbar, vgbar.
 +
;''margin'' : マージン指定。省略可能。
 +
;''legend'' : position in the range 0<=x<1. (Left upper corner is 0 and right lower corner is 1.)
 +
;''label'' : labels for x-axis
 +
;''data'' : name = comma separated values
 +
<br><br>
 +
e.g.<nowiki>{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}</nowiki> =><br>
 +
{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
 +
 
 +
===Database searches===
 +
 
 +
;<h4><nowiki>{{#searchLine: str |namespace='Main'|pagename=''}}</nowiki></h4>:Output all matching lines from page ''pagename'' in ''namespace''.<br>Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.<br>Resulting lines has &amp;&amp;pagename at the beginning of the line.<br>The search is against the wiki source code in edit mode and is case sensitive.<br>e.g. <nowiki>{{#searchLine:sandbox|Main|Sandbox}}</nowiki> => {{#searchLine:sandbox|Main|Sandbox}}
 +
 
 +
;<h4><nowiki>{{#searchLineReg: str |namespace='Main'|pagename=''}}</nowiki></h4>:searchLineと同じ機能ですが、こちらは正規表現が使えます。また、何もヒットしなかった場合はstrをそのまま返します。<br>e.g. <nowiki>{{#searchlinereg:http:.*/|Main}}</nowiki> => <!---{{#searchlinereg:http:.*/|Main}}---->
 +
 
 +
;<h4><nowiki>{{#searchLineNot: str |namespace='Main'|pagename=''}}</nowiki></h4>:使い方はsearchLineと同じでstrが存在しないページのタイトルを返します。<br>e.g. <nowiki>{{#searchlinenot:Extension|Help}}</nowiki> => {{#searchlinenot:Extension|Help}}
 +
 
 +
;<h4><nowiki>{{#searchTitle: str |namespace='Main'}}</nowiki></h4>:Output all matching titles of pages in ''namespace''.<br>Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.<br>The search is case sensitive.<br>e.g. <nowiki>{{#searchTitle:Sandbox.|Main}}</nowiki> => {{#searchtitle:Sandbox.|Main}}
 +
2008/12/4 like検索からregexp検索に変更しました。正規表現の対応は以下の通りです。<br>
 +
| &rarr; ~<br>
 +
ex. abc(d1|d2)ef[123]g &rarr; abc(d1~d2)ef&lt;123&gt;g
 +
 
 +
;
 +
 
 +
<h4><nowiki>{{#countLine: str |namespace='Main'|pagename=''}}</nowiki></h4>:Count all matching lines from page ''pagename'' in ''namespace''.<br>Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.<br>The search is against the wiki source code in edit mode and is case sensitive.<br>e.g. <nowiki>{{#countLine:FL1}}</nowiki> => {{#countLine:FL1}}
 +
 
 +
;<h4><nowiki>{{#countTitle: str |namespace='Main'}}</nowiki></h4>:Count all matching titles of pages in ''namespace''.<br>Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.<br>The search is case sensitive.<br>e.g. <nowiki>{{#countTitle:FL1}}</nowiki> => {{#counttitle:FL1}}
 +
 
 +
===MOL data===
 +
;<h4><nowiki>{{#formula:id=''}}</nowiki><span style="color: red; font-size: small">obsolete</span></h4>:Output formula of the MOL file corresponding to the page title.<br>By specifying id, the target MOL file(s) can be changed. "&&MOL filename&&" will be appended to the returned results.<br>You can use restricted regular expressions (^$*.[] only) in specifying id.<br><br>e.g. <nowiki>{{#formula:FL1A19}}</nowiki> => {{#formula:FL1A19}}
 +
 
 +
;<h4><nowiki>{{#avemass:id=''}}</nowiki><span style="color: red; font-size: small">obsolete</span></h4>:Output average mass of the MOL file corresponding to the page title. The usage of id is the same as <nowiki>{{#formula:}}</nowiki>.<br>e.g. <nowiki>{{#avemass:FL1A19}}</nowiki> => {{#avemass:FL1A19}}
 +
 
 +
;<h4><nowiki>{{#extmass:id=''}}</nowiki><span style="color: red; font-size: small">obsolete</span></h4>:Output exact mass of the MOL file corresponding to the page title. The usage of id is the same as<nowiki>{{#formula:}}</nowiki>.<br>e.g. <nowiki>{{#extmass:FL1A19}}</nowiki> => {{#extmass:FL1A19}}
 +
 
 +
;<h4><nowiki>{{#smiles:id=''}}</nowiki><span style="color: red; font-size: small">obsolete</span></h4>:Output SMILES of the MOL file corresponding to the page title. The usage of id is the same as<nowiki>{{#formula:}}</nowiki>.<br>e.g. <nowiki>{{#smiles:FL1A19}}</nowiki> => {{#smiles:FL1A19}}
 +
 
 +
===Misc===
 +
;<h4><nowiki>{{#clink: pagename}}</nowiki></h4>:Obtain the list of pages linked to the Category page.
 +
 
 +
;<h4><nowiki>{{#getenv: 変数名}}</nowiki></h4>:環境変数の値を取得します。現在は「lang」のみ使用可能です。
 +
 
 +
 
 +
<h2>Meta Extensions</h2>
 +
;<h4><nowiki>{{#jdxfilepath:filename}}</nowiki></h4>:ファイル名前空間のファイルのDocumentRootからのパスを取得します。<br>e.g. <nowiki>{{#jdxfilepath:Salviae miltiorhizae LC-MS.gz}}</nowiki> => {{#jdxfilepath:Salviae miltiorhizae LC-MS.gz}}
 +
 
 +
;<h4><nowiki>{{#jdxfilesize:filename}}</nowiki></h4>:ファイル名前空間のgz圧縮されたファイルのファイルサイズを取得します。<br>e.g. <nowiki>{{#jdxfilesize:Salviae miltiorhizae LC-MS.gz}}</nowiki> => {{#jdxfilesize:Salviae miltiorhizae LC-MS.gz}}
 +
 
 +
 
 +
 
 +
 
 +
<h2>Parse Extensions</h2>
 +
;<h4>Volatile page<nowiki> [[Volatile:pagename|arg1|arg2|...|linkname]]</nowiki></h4>: A page in the Volatile namespace is not cached and is always dynamically generated. A volatile page has the same format as MediaWiki's 'template' and is <i>internal-linked</i> from other pages with arguments.<br>The given arguments will replace {{{X}}} contents in the target volatile page.  Their correspondence is {{{1}}}=arg1, {{{2}}}=arg2 and so on. You may specify argument name {{{ID}}} as<nowiki>[[Volatile:pagename|ID=arg1|linkname]]</nowiki>.
 +
 
 +
;<h4>Persist Page <nowiki> {{#persist:pagename|button_title|template name|number of args|args|separator=;|recursive=false}}</nowiki></h4>: A page in the Persist namespace is always dynamically generated.  The page itself has no content. recursiveはfalseを指定すると、テンプレートを一度だけ展開します。trueを指定すると展開できなくなるまで展開し続けます。<br>
 +
 
 +
 
 +
 
 +
<h2>Special Pages</h2>
 +
 
 +
;<h4>RemoteSearch</h4>:使い方はsearchLineとsearchTitleと同じです。ただ名前空間の指定に$egRemoteSearchURLで指定した識別名を追加するだけです。次の例はlipidbank.jp/wiki/上のCategory名前空間にあるLBをページ名に含むページのリストを取得しています。
 +
 
 +
-== LocalSettings.php ==-<br />
 +
$egRemoteSearchURL = array(<br />
 +
&nbsp;&nbsp;'lipidbank' -> 'lipidbank.jp/wiki/',<br />
 +
);<br />
 +
-== mediawikiページ上 ==-<br />
 +
<nowiki>{{#searchtitle:LB|lipidbank:Category}}
 +
</nowiki><br />
 +
-== 結果 ==-<br />
 +
{{#searchtitle:LB|lipidbank:Category}}
 +
 
 +
;<h4>YankRemoteImage</h4>:使い方は画像表示と同じです。ただ先頭に$egYankRemoteURLで指定した識別名を追加するだけです。次の例はlipidbank.jp/wiki/上にあるLBF09000OX05.pngの画像を呼び出しています。
 +
 
 +
-== LocalSettings.php ==-<br />
 +
$egYankRemoteURL = array(<br />
 +
&nbsp;&nbsp;'lipidbank' -> 'lipidbank.jp/wiki/',<br />
 +
);<br />
 +
-== mediawikiページ上 ==-<br />
 +
<nowiki>[[lipidbank:File:LBF09000OX05.png]]
 +
</nowiki><br />
 +
-== 結果 ==-<br />
 +
[[lipidbank:File:LBF09000OX05.png]]
 +
 
 +
==Others==
 +
;<h4>Search</h4>: Modification of search function
 +
* case independent
 +
* '_' matches any letter
 +
* '%' matches any string
 +
 
 +
==Existing Extensions Installed==
 +
;<h4>CategoryTree</h4>:[http://www.mediawiki.org/wiki/Extension:CategoryTree Extension:CategoryTree]
 +
<!--
 +
;<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]
 +
-->
 +
;<h4>ParserFunctions</h4>:[http://www.mediawiki.org/wiki/Extension:ParserFunctions Extension:ParserFunctions]<br>[http://meta.wikimedia.org/wiki/Help:ParserFunctions Help]
 +
;<h4>Variables</h4>:[http://www.mediawiki.org/wiki/Extension:Variables Extension:Varibles]
 +
 
 +
==Original Extensions==
 +
* [[Help:Extension/Volatile|Volatile namespace]]
 +
* [[Help:Extension/Persistency|Persist namespace]]
 +
* [[Help:Extension/HTMLForm|Form tag in HTML]]
 +
* [[Help:Extension/Wbr|Wbr tag in HTML]]
 +
* [[Help:Extension/MySQLLikeSearch|SQL-like search]]
 +
* [[Help:Extension/ExtendedFunctions|String functions]]
 +
* [[Help:Extension/ScriptFunctions|Calling Lua program]]
 +
* [[Help:Extension/MolFunctions|MOL-format file functions]]
 +
* [[Help:Extension/CreateGraph|Graph drawing]]
 +
* [[Help:Extension/RemoteSearch|Remote search]]
 +
* [[Help:Extension/YankRemoteImage|Yank remote image]]

Latest revision as of 22:46, 28 February 2011

The list of original commands implemented on the Metabolomics.jp server.


Contents

[edit] Tags

<wbr>

Output <wbr> of HTML

[edit] Parser Functions

  • Arguments written without default values are required.

[edit] data structure

{{#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

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

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

{{#max:num1|num2|...|numN}}

一番大きな値を返します。数字以外が入っていた場合は-1を返します。
e.g. {{#max:5|10|2|24|4|1|12}} => 24

{{#min:num1|num2|...|numN}}

一番小さな値を返します。数字以外が入っていた場合は-1を返します。
e.g. {{#min:5|10|2|24|4|1|12}} => 0

{{#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

{{#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

{{#choose:line1 \n line2 \n lin3...|string}}

最初の引数から、stringにマッチする行だけを返します.
e.g. {{#choose:abc1
def2
1234|1}} => abc1

1234


[edit] string functions

{{#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"

{{#trim:str}}

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

{{#trimex:str}}

str中のタブと改行を全て削除します。
e.g. {{#trimex:a bc def(\n)}} => abcdef

{{#length:str}}

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

{{#count:str|pattern}}

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

{{#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

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

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

{{#cr:}}

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

(return)

{{#bar:}}

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

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

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

{{#encode:str}}

渡された文字列内の記号を%と二桁の数値に変換します。
e.g. {{#encode:a%b#c!d=e}} => %61%25%62%23%63%21%64%3D%65

{{#decode:str}}

で変換された文字列を元に戻します。
e.g. {{#decode:%61%25%62%23%63%21%64%3D%65}} => a%b#c!d=e

{{#createstring:str|num}}

strをnum回 繰り返した文字列を返します。
e.g. {{#createstring:abc|3}} => abcabcabc

{{#upcase:str}}

strを全て大文字に変えます。
e.g. {{#upcase:abc}} => ABC

{{#downcase:str}}

strを全て小文字に変えます。
e.g. {{#downcase:ABC}} => abc


[edit] flow and IO controls

{{#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}}

{{#repeatnum:template|argc|argl|separator="\n"}}

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.
{{#repeat:}}との相違点は、展開時にテンプレート引数の頭に「n=」と番号付けされること。
e.g. {{#repeatnum:template|3|a,b,c,d,e,f,g,h,i|,}} => {{template|1=a|2=b|3=c}}{{template|1=d|2=e|3=f}}{{template|1=g|2=h|3=i}}

{{#map:template|argc|argv1|argv2|...|argvN}}

repeatと同じ機能ですが、こちらは引数を'|'区切りで渡します。
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}}

{{#ifexistfile:path}}

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

{{#ifexists:page}}

Checks whether the specified page exists. Different from the original 'ifexist' command, it does not check the visible contents in the page.
e.g. {{#ifexists:Image:KOX00002.png|true|false}} => true

{{#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>

{{#lua:program|arg}}

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


{{#get:name}}

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

{{#formtag: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. {{#formtag:input|type="submit"}} => <input type="submit">
e.g. {{#formtag:form|action="-"|...}} => <form action="-" method="post">...</form>

2008/12/4 {{#tag:}}から{{#formtag:}}に変更しました。

{{#graph:type|size=[Width]x[Height];margin=[left=40],[right=20],[top=40],[bottom=40];title=[title];legend=[Left]x[Top];label=[label1],[label2],...;[data1]=[n1-1],[n1-2],...;[data2]=[n2-1],[n2-2],...;...}}

Generate graph by jpgraph.

type 
pie, pie3d, line, hvar, hgbar, vbar, vgbar.
margin 
マージン指定。省略可能。
legend 
position in the range 0<=x<1. (Left upper corner is 0 and right lower corner is 1.)
label 
labels for x-axis
data 
name = comma separated values



e.g.{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}} =>

[edit] Database searches

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

Output all matching lines from page pagename in namespace.
Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.
Resulting lines has &&pagename at the beginning of the line.
The search is against the wiki source code in edit mode and is case sensitive.
e.g. {{#searchLine:sandbox|Main|Sandbox}} =>

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

searchLineと同じ機能ですが、こちらは正規表現が使えます。また、何もヒットしなかった場合はstrをそのまま返します。
e.g. {{#searchlinereg:http:.*/|Main}} =>

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

使い方はsearchLineと同じでstrが存在しないページのタイトルを返します。
e.g. {{#searchlinenot:Extension|Help}} => &&CheckReference

&&PKS &&Pictures &&Reference


{{#searchTitle: str |namespace='Main'}}

Output all matching titles of pages in namespace.
Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.
The search is case sensitive.
e.g. {{#searchTitle:Sandbox.|Main}} => Sandbox/abbrev

Sandbox/orderList Sandbox00 Sandbox000 Sandbox0000 Sandbox0001 Sandbox0002 Sandbox001 Sandbox11 Sandbox111 Sandbox123 Sandbox13 Sandbox15 Sandbox2 Sandbox3 Sandbox33 Sandbox34 Sandbox4 Sandbox40 Sandbox5 Sandbox51 Sandbox52 Sandbox6 Sandbox7 Sandbox80 Sandbox88 Sandbox90 Sandbox91 Sandbox92 Sandbox93 Sandbox94 Sandbox95 Sandbox96 Sandbox98 Sandbox99 SandboxS Sandbox_JDXCompress

2008/12/4 like検索からregexp検索に変更しました。正規表現の対応は以下の通りです。
| → ~
ex. abc(d1|d2)ef[123]g → abc(d1~d2)ef<123>g

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

:Count all matching lines from page pagename in namespace.
Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.
The search is against the wiki source code in edit mode and is case sensitive.
e.g. {{#countLine:FL1}} => 0

{{#countTitle: str |namespace='Main'}}

Count all matching titles of pages in namespace.
Title head and tail, any single character and multiple characters can be specified by ^ and $, _ and %, respectively.
The search is case sensitive.
e.g. {{#countTitle:FL1}} => 690

[edit] MOL data

{{#formula:id=''}}obsolete

Output formula of the MOL file corresponding to the page title.
By specifying id, the target MOL file(s) can be changed. "&&MOL filename&&" will be appended to the returned results.
You can use restricted regular expressions (^$*.[] only) in specifying id.

e.g. {{#formula:FL1A19}} => {{#formula:FL1A19}}

{{#avemass:id=''}}obsolete

Output average mass of the MOL file corresponding to the page title. The usage of id is the same as {{#formula:}}.
e.g. {{#avemass:FL1A19}} => {{#avemass:FL1A19}}

{{#extmass:id=''}}obsolete

Output exact mass of the MOL file corresponding to the page title. The usage of id is the same as{{#formula:}}.
e.g. {{#extmass:FL1A19}} => {{#extmass:FL1A19}}

{{#smiles:id=''}}obsolete

Output SMILES of the MOL file corresponding to the page title. The usage of id is the same as{{#formula:}}.
e.g. {{#smiles:FL1A19}} => {{#smiles:FL1A19}}

[edit] Misc

{{#clink: pagename}}

Obtain the list of pages linked to the Category page.

{{#getenv: 変数名}}

環境変数の値を取得します。現在は「lang」のみ使用可能です。


Meta Extensions

{{#jdxfilepath:filename}}

ファイル名前空間のファイルのDocumentRootからのパスを取得します。
e.g. {{#jdxfilepath:Salviae miltiorhizae LC-MS.gz}} => /mediawiki/images/0/09/Salviae_miltiorhizae_LC-MS.gz

{{#jdxfilesize:filename}}

ファイル名前空間のgz圧縮されたファイルのファイルサイズを取得します。
e.g. {{#jdxfilesize:Salviae miltiorhizae LC-MS.gz}} => 6085097



Parse Extensions

Volatile page [[Volatile:pagename|arg1|arg2|...|linkname]]

A page in the Volatile namespace is not cached and is always dynamically generated. A volatile page has the same format as MediaWiki's 'template' and is internal-linked from other pages with arguments.
The given arguments will replace {{{X}}} contents in the target volatile page. Their correspondence is {{{1}}}=arg1, {{{2}}}=arg2 and so on. You may specify argument name {{{ID}}} as[[Volatile:pagename|ID=arg1|linkname]].

Persist Page {{#persist:pagename|button_title|template name|number of args|args|separator=;|recursive=false}}

A page in the Persist namespace is always dynamically generated. The page itself has no content. recursiveはfalseを指定すると、テンプレートを一度だけ展開します。trueを指定すると展開できなくなるまで展開し続けます。


Special Pages

RemoteSearch

使い方はsearchLineとsearchTitleと同じです。ただ名前空間の指定に$egRemoteSearchURLで指定した識別名を追加するだけです。次の例はlipidbank.jp/wiki/上のCategory名前空間にあるLBをページ名に含むページのリストを取得しています。

-== LocalSettings.php ==-
$egRemoteSearchURL = array(
  'lipidbank' -> 'lipidbank.jp/wiki/',
);
-== mediawikiページ上 ==-
{{#searchtitle:LB|lipidbank:Category}}
-== 結果 ==-


YankRemoteImage

使い方は画像表示と同じです。ただ先頭に$egYankRemoteURLで指定した識別名を追加するだけです。次の例はlipidbank.jp/wiki/上にあるLBF09000OX05.pngの画像を呼び出しています。

-== LocalSettings.php ==-
$egYankRemoteURL = array(
  'lipidbank' -> 'lipidbank.jp/wiki/',
);
-== mediawikiページ上 ==-
[[lipidbank:File:LBF09000OX05.png]]
-== 結果 ==-

[edit] Others

Search

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

[edit] Existing Extensions Installed

CategoryTree

Extension:CategoryTree

ParserFunctions

Extension:ParserFunctions
Help

Variables

Extension:Varibles

[edit] Original Extensions

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox