Help:Extensions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 89: Line 89:
 
;<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>
 
;<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>
  
;<h4><nowiki>{{#graph:type|size=[Width]x[Hheight];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. The ''type'' can be pie, pie3d, line, hvar, hgbar, vbar, vgbar. <br>legendは説明の位置を指定するオプションであり、「0<=x<1」で指定する。これは左上(もしくは最上)を0、右端(もしくは最下)を1とし、小数点で指定する。<br>labelはx軸に表示するラベル群であり、「\n」を用いることで、改行することもできる。<br>最後にdata1,data2(名前は任意、ここに指定したものが説明に表示される)として、描画するデータを指定する。<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>
+
;<h4><nowiki>{{#graph:type|size=[Width]x[Hheight];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.
 +
;''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}}
 
{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
 
<!--
 
;<h4><nowiki>{{#graph:type|size|data|label=''|title=''|sep=''|ex_horz_pos=''|ex_vert_pos=''}}</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 ','.「,」がデータ内にある場合は「sep」で別の区切り文字を指定できる。ex_horz_posとex_vert_posは説明の位置を指定するオプションであり、「0<=x<1」で指定する。これは左上(もしくは最上)を0、右端(もしくは最下)を1とし、小数点で指定する。<br>e.g. <nowiki>{{#graph:pie|100x100|12,34,21|ID1,ID2,ID3|Title|0.1|0.1}}</nowiki> =><br> {{#graph:pie|300x300|12,34,21|ID1,ID2,ID3|Title||0.1|0.1}}
 
-->
 
 
  
 
===Database searches===
 
===Database searches===

Revision as of 16:16, 20 September 2008

The list oforiginal commands implemented on the Metabolomics.jp server.


Contents

Tags

<wbr>

Output <wbr> of HTML

Parser Functions

  • Arguments written without default values are required.

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

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

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

{{#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, use  .
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

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

{{#ifexistfile:path}}

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

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


{{#get:name}}

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

{{#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=[Width]x[Hheight];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.
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}} =>

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}} =>

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


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

MOL data

{{#formula:id=''}}

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=''}}

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=''}}

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=''}}

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

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=;}}

A page in the Persist namespace is always dynamically generated. The page itself has no content.

Special Pages

Others

Search

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

Installed Extensions

CategoryTree

Extension:CategoryTree

ParserFunctions

Extension:ParserFunctions
Help

Variables

Extension:Varibles

Original Extensions

Volatile namespace

Persist namespace

HTML tags

HTML form

SQL-like search

String functions

Script functions

MOL-file functions

Graph drawing

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox