Help:Extensions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 48: Line 48:
 
;<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>{{#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>{{#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}}
+
;<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. また「_」は任意の一文字、「%」は任意の文字列(0文字以上)を表すワイルドカードとなる。<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.大文字小文字は区別される。<br>e.g. <nowiki>{{#searchLine:sandbox|Main|Sandbox}}</nowiki> => {{#searchLine:sandbox|Main|Sandbox}}
  
 
;<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|;}}
 
;<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|;}}
Line 83: Line 83:
  
 
;<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>{{#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>{{#searchTitle: str |namespace='Main'}}</nowiki></h4>:与えられた検索語を含むタイトルを持つページを、指定された名前空間から探しだしその結果を返す。<br>検索後は「^」を先頭につけることで文頭、「$」を末尾につけることで文末指定が可能。また「_」は任意の一文字、「%」は任意の文字列(0文字以上)を表すワイルドカードとなる。大文字小文字は区別される。<br>e.g. <nowiki>{{#searchTitle:Sandbox_|Main}}</nowiki> => {{#searchtitle:Sandbox_|Main}}
  
 
<h2>SpecialPage</h2>
 
<h2>SpecialPage</h2>

Revision as of 13:51, 17 March 2008

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

Contents

Variables

[[MEDIAWIKIROOT]]

/mediawiki

Path string from DOCUMENT_ROOT to the mediawiki folder

[[APPLETROOT]]

/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. また「_」は任意の一文字、「%」は任意の文字列(0文字以上)を表すワイルドカードとなる。
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


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

与えられた検索語を含むタイトルを持つページを、指定された名前空間から探しだしその結果を返す。
検索後は「^」を先頭につけることで文頭、「$」を末尾につけることで文末指定が可能。また「_」は任意の一文字、「%」は任意の文字列(0文字以上)を表すワイルドカードとなる。大文字小文字は区別される。
e.g. {{#searchTitle:Sandbox_|Main}} => Sandbox_JDXCompress


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