Help:Extensions

From Metabolomics.JP
Revision as of 14:32, 27 August 2010 by Editor (Talk | contribs)

Jump to: navigation, search

The list of original 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

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


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

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


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

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}} => &&FL2FAEGS0001ヘスペリジンのトリビアページ

&&FL7AAGGO0002| style="width: 35%;" | LipidBank &&FL7AAGGO0002| style="width: 65%;" | [1] &&FL7AAGGO0002| style="width: 35%;" | LipidMaps &&FL7AAGGO0002| style="width: 65%;" | [2] &&FL7AAGGO0002| style="width: 35%;" | KEGG &&FL7AAGGO0002| style="width: 65%;" | {{{KEGG}}} &&FL7AAGGO0002| style="width: 35%;" | KNApSAcK &&FL7AAGGO0002C00006699 &&Main_Page(compilation with NAIST) &&Main_Page(with NAIST & Toyama Univ.) &&Main_PageAllied DB : KNApSAcK : MassBank : LipidBank &&Main_PageSpectral DB : HMDB : NIST Chemistry WebBook : NIST Library search program : SDBS : SpectroscopyNow : UK Chemical DB Service : Univ Wisconsin BioMagResBank : Univ. Alberta MS library : Univ. Georgia Complex Carbohydrate DB : Univ. Pennsylvania ChemPen Project &&Main_PageChemical DB : ChemFinder : CTFile format : Daylight Documentation : Merck online catalog : NCI database : PubChem : ZINC

&&Main_Page
Pathway DB : BioCarta : Biochemical Pathways : BioCyc : KEGG : Univ. Minnesota BBD : KaPPA-View : MapMan : TAIR

&&Main_PageNatural Compound DB : AU techno-service Co. : Encyclopaedia of Plant Metabolites : Pherobase &&Main_PageGenome DB : MBGD: Microbial Genome Database : Genobase : Sol genomics network &&Sandbox13:姓名判断のページから13画一文字 &&Sandbox13:姓名判断のページから10画-3画 &&Sandbox13:姓名判断のページから9画-4画 &&Sandbox13:姓名判断のページから8画-5画 &&Sandbox13:姓名判断のページから7画-6画 &&Sandbox13:姓名判断のページから6画-7画 &&Sandbox13:姓名判断のページから5画-8画 &&Sandbox13:姓名判断のページから4画-9画 &&Sandbox13:姓名判断のページから3画-10画 &&Sandbox2Banisteriopsis&&An Ethnobotanical Perspective on Ayahuasca&&http://www.biopark.org/peru/schultes-ayahuasca.html&&薬効に関する記述 &&Sandbox2Copaifera&&Tropical Plant Database&&http://www.rain-tree.com/copaiba.htm&& &&Sandbox2Physostigma&&医薬品情報21 eserin&&http://www.drugsinfo.jp/2007/08/16-230700&& &&Sandbox2Robina&&Floridata Plant Info.&&http://www.floridata.com/ref/R/robinia.cfm&& &&Sandbox2Agavaceae&&Plant Image Gallery (Dracaenaceae)&&http://pharm1.pharmazie.uni-greifswald.de/gallery/gal-drac.htm&& &&Sandbox2Betulaceae&&Plant Image Gallery (Corylaceae)&&http://pharm1.pharmazie.uni-greifswald.de/gallery/gal-cory.htm&& &&Sandbox2Cyperaceae&&岡山理科大学星野研究室&&http://hos0.big.ous.ac.jp/~hoshino/Labo/colorzukan/hyousi.htm&& over 250 genus pics in Cyperaceae &&Sandbox2Hamamelidaceae&&Plant Image Gallery (Altingiaceae)&&http://pharm1.pharmazie.uni-greifswald.de/gallery/gal-alti.htm&& &&Sandbox52http://www.info.pmda.go.jp/psearch/PackinsSearch?dragname=%B0%C2%C3%E6%BB%B6&effect=520&count=800&start=1 &&Sandbox52http://www.info.pmda.go.jp/psearch/PackinsSearch?dragname={{#encode:安中散|EUC-JP}}&effect=520&count=800&start=1 &&ToyamaWorkshop2013公立学校共済組合「立山高原ホテル」 &&ToyamaWorkshop2013sponsored by Toyamalogo.gif and 北陸質量分析談話会 &&ToyamaWorkshop2013:: Please take the flight ANA883 (Haneda 9:30 - Toyama 10:30) more info. Our courtesy bus waits at the airport. &&ToyamaWorkshop2013:: Please take the Thunderbird train Nr.7 (Osaka 8:40 - Toyama 11:57) more info. Our courtesy bus waits at the North Exit of Toyama Station.


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

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

Misc

{{#clink: pagename}}

Obtain the list of pages linked to the Category page.

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

Existing Extensions Installed

CategoryTree

Extension:CategoryTree

ParserFunctions

Extension:ParserFunctions
Help

Variables

Extension:Varibles

Original Extensions

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox