Difference between revisions of "Help:ABC extensions syntax"

From "A B C"
Jump to navigation Jump to search
m
 
(48 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
</div>
 
</div>
  
Several extension use special syntax. This is a synopsis.
+
This is a synopsis of special extensions and template syntax on this Wiki.
  
 
__NOTOC__
 
__NOTOC__
  
;Site specific templates
+
 
 +
==LST==
 +
Using this markup, you can arbitrarily label sections from other pages and transclude them into the current page. This is not just convenient, it is essential to avoid duplicating text that will not get consistently updated if it exists multiple times on the Wiki.
  
  
 
;LST (Labeling a section for transclusion)
 
;LST (Labeling a section for transclusion)
  <nowiki><section begin=exercises /></nowiki>
+
  <nowiki><section begin=section-name /></nowiki>
 
  ...
 
  ...
  <nowiki><section end=exercises /></nowiki>
+
  <nowiki><section end=section-name /></nowiki>
  
  
 
;LST (Transcluding a labeled section)
 
;LST (Transcluding a labeled section)
  <nowiki>{{#lst:Transcriptome|exercises}}</nowiki>
+
  <nowiki>{{#lst:Page-name|section-name}}</nowiki>
:Common sections are: <code>reading</code> and <code>exercises</code>.
+
 
 +
;Example
 +
<section begin=occam />''Entia non sunt ponenda praeter necessitatem.'' (Occam)<section end=occam />
 +
 
 +
{{#lst:Help:ABC_extensions_syntax|occam}}
 +
 
 +
==Syntax Highlight==
 +
[http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi '''GeSHI''']
  
;Pubmedparser  
+
<nowiki><source lang="R">y <- as.character("yadda"); 2* y #yadda yadda</source></nowiki>
  <nowiki>{{#pmid:12345678}}</nowiki>
+
<source lang="r"> y <- as.character("yadda"); 2* y #yadda yadda</source>
 +
* lang="??"
 +
* line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS"
 +
* line start="??"
 +
* highlight="??"
 +
* enclose="pre|div|none" ... (div induces wrapping))
 +
 
 +
==Pubmedparser==
 +
  <nowiki>{{#pmid:15289071}}</nowiki>
 
:This inserts the article information in a <code>&lt;div></code>, formatted by [[Template:Pubmed]].
 
:This inserts the article information in a <code>&lt;div></code>, formatted by [[Template:Pubmed]].
 +
{{#pmid:15289071}}
 +
 +
 
  <nowiki>{{#pmid: 15289071 |Steipe2004}}</nowiki>
 
  <nowiki>{{#pmid: 15289071 |Steipe2004}}</nowiki>
:This formats the output for the Cite extension; A footnote mark will be inserted at the edit location and the actual reference will appear beneath the <code>&lt;references /></code> section of the page.
+
:This formats the pubmed parser output for the Cite extension; A footnote mark will be inserted ''here''{{#pmid: 15289071 |Steipe2004}} and the actual reference will appear beneath the <code>&lt;references /></code> section of the page. Multiple citations of the same reference can use the same template, or equivalently use <code>&lt;ref name="Steipe2004" /&gt;</code>.
 +
 
 +
 
 +
 
 +
===Non-Pubmed pdf===
 +
 
 +
If the article is not on PubMed use [[Template:PDF]]. Upload the article to the repository, enter bibliographic details and make sure <code>file</code> the filename is unique with full extension.
 +
 
 +
&#123;&#123;PDF
 +
&#124;authors=
 +
&#124;year=
 +
&#124;title=
 +
&#124;journal=
 +
&#124;volume=
 +
&#124;pages=
 +
&#124;URL=
 +
&#124;doi=
 +
&#124;file=
 +
&#124;abstract=
 +
&#125;&#125;
 +
 
 +
{{PDF
 +
|authors= Ambrish, R. & Zhang, Y.
 +
|year= 2012
 +
|title= Protein Structure Prediction
 +
|journal= Encyclopedia of Life Sciences
 +
|volume=
 +
|pages=
 +
|URL= http://zhanglab.ccmb.med.umich.edu/papers/2012_12.pdf
 +
|doi =
 +
|file= Zhang(2012)StructurePrediction.pdf
 +
|abstract= The goal of protein structure prediction is to estimate the spatial position of every atom of protein molecules from the amino acid sequence by computational methods. Depending on the availability of homologous templates in the PDB library, structure prediction approaches are categorised into template-based modelling (TBM) and free modelling (FM). While TBM is by far the only reliable method for high-resolution structure prediction, challenges in the field include constructing the correct folds without using template structures and refining the template models closer to the native state when templates are available. Nevertheless, the usefulness of various levels of protein structure predictions have been convincingly demonstrated in biological and medical applications.
 +
}}
 +
 
 +
{{Vspace}}
 +
 
 +
===Non-Pubmed DOI===
 +
 
 +
If the article is copyrighted, don't post the PDF but use [[Template:DOI]]. Enter bibliographic details in particular <code>DOI</code> and/or <code>URL</code>.
 +
 
 +
&#123;&#123;DOI
 +
&#124;authors=
 +
&#124;year=
 +
&#124;title=
 +
&#124;journal=
 +
&#124;volume=
 +
&#124;pages=
 +
&#124;url=
 +
&#124;doi=
 +
&#124;abstract=
 +
&#125;&#125;
 +
 
 +
{{DOI
 +
|authors= Duncan J Murdoch, Yu-Ling Tsai & James Adcock
 +
|year= 2008
 +
|title= P-Values are Random Variables
 +
|journal= The American Statistician
 +
|volume= 62:3
 +
|pages= 242-245
 +
|URL=
 +
|doi = 10.1198/000313008X332421
 +
|file= Zhang(2012)StructurePrediction.pdf
 +
|abstract= ''P''-values are taught in introductory statistics classes in a way that confuses many of the students, leading to common misconceptions about their meaning. In this article, we argue that ''p''-values should be taught through simulation, emphasizing that ''p''-values are random variables. By means of elementary examples we illustrate how to teach students valid interpretations of ''p''-values and give them a deeper understanding of hypothesis testing.
 +
}}
 +
 
 +
{{Vspace}}
 +
 
 +
==Cite==
 +
;Inserting a footnote
 +
:A note in :&lt;ref&gt;:&lt;/ref&gt; tags will insert a footnote mark, linked to the text in the &lt;references /&gt; section of the page.
 +
 
 +
This is the text&lt;ref&gt;And this is the footnote:&lt;/ref&gt;.
 +
 
 +
 
 +
This is the text<ref>And this is the footnote</ref>.
 +
 
 +
Use <code>&lt;ref name="some-name"&gt;Text ...&lt;/ref&gt;</code> for the first of multiple citations of the same reference; then use <code>&lt;ref name="some-name" /ref&gt;</code> for subsequent citations.
 +
 
 +
For more options, see [https://www.mediawiki.org/wiki/Extension:Cite here].
 +
 
 +
 
 +
<hr />
 +
<references />
 +
 
 +
==Misc.==
 +
{{Vspace}}
 +
====raw HTML====
 +
Once <code>$wgRawHtml = true;</code> has been set, raw HTML can be used in <code>&lt;html&gt;...&lt;/html&gt;</code> tags (https://www.mediawiki.org/wiki/Manual:$wgRawHtml).
 +
 
 +
This allows to put Google Docs in iFrames (https://wcmshelp.ucsc.edu/advanced/embedding-google/index.html):
 +
 
 +
<html>
 +
<iframe src="https://docs.google.com/presentation/d/e/2PACX-1vTSqtVMXf2OC1k787ALJ43qpMwyaRy6pGBqCRZGjUMW7SapDyhLfdYZ9OpXk1quvcLthyVnvWlcrV6S/embed?start=false&loop=false&delayms=9999999" frameborder="0" width="360" height="509" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
 +
<img src="https://docs.google.com/drawings/d/e/2PACX-1vRYfclMZ7ovR26i2KAN8bbzmBWApImKH4tPuk66ZYwkU1H9-zy0BkuS_JFrPjwpcBqwCriY2YDCwaWH/pub?w=480&amp;h=360">
 +
</html>
 +
 
 +
====CC-BY====
 +
<code><nowiki>{{CC-BY}}</nowiki></code>
 +
{{CC-BY}}
 +
 
 +
 
 +
====PDFInclude====
 +
&lt;pdf&gt;http://steipe.biochemistry.utoronto.ca/abc/CourseMaterials/BCH441/02-SequenceData_2014.pdf&lt;/pdf&gt;
 +
&lt;pdf width="300px" height="400px"&gt;http://steipe.biochemistry.utoronto.ca/abc/CourseMaterials/BCH441/02-SequenceData_2014.pdf&lt;/pdf&gt;
 +
 
 +
 
 +
====Math markup====
 +
&lt;math&gt;H = - \sum_{i=0}^n p_i \log_{2} p_i&lt;/math&gt;
 +
 
 +
 
 +
<math>H = - \sum_{i=0}^n p_i \log_{2} p_i</math><br />
 +
:see: http://meta.wikimedia.org/wiki/Help:Formula
 +
 
 +
 
 +
====Inserting a Web-site box====
 +
Boxes for Web site summaries, image and abstract
 +
<nowiki>{{WWW|WWW_UniProt}} </nowiki>
 +
{{WWW|WWW_UniProt}}
 +
 
  
<!-- {{WWW|WWW_UniProt}} -->
+
====Inserting an emphasis box====
<!-- <div class="reference-box">[http://www.ncbi.nlm.nih.gov]</div> -->
+
<nowiki><div class="emphasis-box">Getting the data model right is the key to eternal bliss.</div></nowiki>
 +
<div class="emphasis-box">Getting the data model right is the key to eternal bliss.</div>
  
  
 
&nbsp;
 
&nbsp;
 +
 +
====Inserting a Web-link box====
 +
<nowiki><div class="reference-box">[http://www.ncbi.nlm.nih.gov '''The NCBI''']</div></nowiki>
 +
<div class="reference-box">[http://www.ncbi.nlm.nih.gov '''The NCBI''']</div>
 +
 +
====Linking text to '''R''' documentation ====
 +
<table style="border:solid 1px #000000">
 +
<tr>
 +
<th>&nbsp;</th>
 +
<th>&nbsp;</th>
 +
<th style="text-align:left;"><code>Code</code></th>
 +
<th>&nbsp;</th>
 +
<th style="text-align:left;">Result</th>
 +
</tr><tr>
 +
<tr>
 +
<td style="text-align:right;">base function only:</td>
 +
<td>&nbsp;</td>
 +
<td><code><nowiki>{{R|mean()}}</nowiki></code></td>
 +
<td>&nbsp;</td>
 +
<td>{{R|mean()}}</td>
 +
</tr><tr>
 +
<td style="text-align:right;">base function with different linked text:</td>
 +
<td>&nbsp;</td>
 +
<td><code><nowiki>{{R|mean()|the '''mean()''' function}}</nowiki></code></td>
 +
<td>&nbsp;</td>
 +
<td>{{R|mean()|the '''mean()''' function}}</td>
 +
</tr><tr>
 +
<td style="text-align:right;">package (note: no parentheses ):</td>
 +
<td>&nbsp;</td>
 +
<td><code><nowiki>{{R|knitr}}</nowiki></code></td>
 +
<td>&nbsp;</td>
 +
<td>{{R|knitr}}</td>
 +
</tr><tr>
 +
<td style="text-align:right;">function in non-base package:</td>
 +
<td>&nbsp;</td>
 +
<td><code><nowiki>{{R|graphics|par()}}</nowiki></code></td>
 +
<td>&nbsp;</td>
 +
<td>{{R|graphics|par()}}</td>
 +
</tr><tr>
 +
<td style="text-align:right;">function with different text:</td>
 +
<td>&nbsp;</td>
 +
<td><code><nowiki>{{R|grDevices|colorRamp()|colorRampPalette()}}</nowiki></code></td>
 +
<td>&nbsp;</td>
 +
<td>{{R|grDevices|colorRamp()|colorRampPalette()}}</td>
 +
</tr>
 +
</table>
 +
 +
 +
Create link to online '''R''' documentation. If a name is followed by <code>()</code> it's a function, otherwise a package. If a package is given alone, link to the package documentation, otherwise to the package/function page. The ''base'' package is default, other packages can be chosen with the template's second parameter. If a third parameter is present, that will be the linked text. All documentation is pulled from [http://www.rdocumentation.org/ '''rdocumentation.org'''] and this should include CRAN as well as bioconductor packages.
 +
 +
====Linking text to Wikipedia====
 +
<nowiki>{{WP|Mutual information|'''Mutual Information'''}}</nowiki>
 +
{{WP|Mutual information|'''Mutual Information'''}}
 +
 +
====Collapsible elements====
 +
See: [http://www.mediawiki.org/wiki/Manual:Collapsible_elements Manual: Collapsible elements]
 +
 +
<nowiki>
 +
<div class="mw-collapsible mw-collapsed" data-expandtext="Expand" data-collapsetext="Collapse" style="width:50%; ">
 +
* Visible text 
 +
<div class="mw-collapsible-content" style="padding:10px;">
 +
* Collapsed text 1
 +
* Collapsed text 2
 +
* Collapsed text 3
 +
</div>
 +
</div>
 +
</nowiki>
 +
 +
<div class="mw-collapsible mw-collapsed" data-expandtext="Expand for poem" data-collapsetext="Collapse" style="width:40%; border:solid 1px; background-color:#F6FFE6; padding:10px;">'''The Road Not Taken'''&nbsp;&nbsp;&nbsp;&nbsp;<small>''Robert Frost''</small> 
 +
<div class="mw-collapsible-content">
 +
Two roads diverged in a yellow wood,<br />And sorry I could not travel both<br />And be one traveler, long I stood<br />And looked down one as far as I could<br />To where it bent in the undergrowth;<br />&nbsp;<br />Then took the other, as just as fair,<br />And having perhaps the better claim<br />Because it was grassy and wanted wear,<br />Though as for that the passing there<br />Had worn them really about the same,<br />&nbsp;<br />And both that morning equally lay<br />In leaves no step had trodden black.<br />Oh, I marked the first for another day!<br />Yet knowing how way leads on to way<br />I doubted if I should ever come back.<br />&nbsp;<br />I shall be telling this with a sigh<br />Somewhere ages and ages hence:<br />Two roads diverged in a wood, and I,<br />I took the one less traveled by,<br />And that has made all the difference.
 +
</div>
 +
</div>
  
 
</div>
 
</div>

Latest revision as of 16:33, 25 February 2019

Extension Syntax

This is a synopsis of special extensions and template syntax on this Wiki.



LST

Using this markup, you can arbitrarily label sections from other pages and transclude them into the current page. This is not just convenient, it is essential to avoid duplicating text that will not get consistently updated if it exists multiple times on the Wiki.


LST (Labeling a section for transclusion)
<section begin=section-name />
...
<section end=section-name />


LST (Transcluding a labeled section)
{{#lst:Page-name|section-name}}
Example

Entia non sunt ponenda praeter necessitatem. (Occam)

Entia non sunt ponenda praeter necessitatem. (Occam)

Syntax Highlight

GeSHI

<source lang="R">y <- as.character("yadda"); 2* y #yadda yadda</source>
 y <- as.character("yadda"); 2* y #yadda yadda
  • lang="??"
  • line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS"
  • line start="??"
  • highlight="??"
  • enclose="pre|div|none" ... (div induces wrapping))

Pubmedparser

{{#pmid:15289071}}
This inserts the article information in a <div>, formatted by Template:Pubmed.
Steipe (2004) Consensus-based engineering of protein stability: from intrabodies to thermostable enzymes. Meth Enzymol 388:176-86. (pmid: 15289071)

PubMed ] [ DOI ]


{{#pmid: 15289071 |Steipe2004}}
This formats the pubmed parser output for the Cite extension; A footnote mark will be inserted here[1] and the actual reference will appear beneath the <references /> section of the page. Multiple citations of the same reference can use the same template, or equivalently use <ref name="Steipe2004" />.


Non-Pubmed pdf

If the article is not on PubMed use Template:PDF. Upload the article to the repository, enter bibliographic details and make sure file the filename is unique with full extension.

{{PDF
|authors= 
|year= 
|title= 
|journal= 
|volume= 
|pages= 
|URL= 
|doi= 
|file= 
|abstract= 
}}


Ambrish, R. & Zhang, Y. (2012) Protein Structure Prediction. Encyclopedia of Life Sciences 
(pmid: None)Source URL ] The goal of protein structure prediction is to estimate the spatial position of every atom of protein molecules from the amino acid sequence by computational methods. Depending on the availability of homologous templates in the PDB library, structure prediction approaches are categorised into template-based modelling (TBM) and free modelling (FM). While TBM is by far the only reliable method for high-resolution structure prediction, challenges in the field include constructing the correct folds without using template structures and refining the template models closer to the native state when templates are available. Nevertheless, the usefulness of various levels of protein structure predictions have been convincingly demonstrated in biological and medical applications.


 

Non-Pubmed DOI

If the article is copyrighted, don't post the PDF but use Template:DOI. Enter bibliographic details in particular DOI and/or URL.

{{DOI
|authors= 
|year= 
|title= 
|journal= 
|volume= 
|pages= 
|url= 
|doi= 
|abstract= 
}}


Duncan J Murdoch, Yu-Ling Tsai & James Adcock (2008) P-Values are Random Variables. The American Statistician 62:3:242-245. (pmid: None)
DOI ] P-values are taught in introductory statistics classes in a way that confuses many of the students, leading to common misconceptions about their meaning. In this article, we argue that p-values should be taught through simulation, emphasizing that p-values are random variables. By means of elementary examples we illustrate how to teach students valid interpretations of p-values and give them a deeper understanding of hypothesis testing.


 

Cite

Inserting a footnote
A note in :<ref>:</ref> tags will insert a footnote mark, linked to the text in the <references /> section of the page.
This is the text<ref>And this is the footnote:</ref>.


This is the text[2].

Use <ref name="some-name">Text ...</ref> for the first of multiple citations of the same reference; then use <ref name="some-name" /ref> for subsequent citations.

For more options, see here.



  1. Steipe (2004) Consensus-based engineering of protein stability: from intrabodies to thermostable enzymes. Meth Enzymol 388:176-86. (pmid: 15289071)

    PubMed ] [ DOI ]

  2. And this is the footnote

Misc.

 

raw HTML

Once $wgRawHtml = true; has been set, raw HTML can be used in <html>...</html> tags (https://www.mediawiki.org/wiki/Manual:$wgRawHtml).

This allows to put Google Docs in iFrames (https://wcmshelp.ucsc.edu/advanced/embedding-google/index.html):

CC-BY

{{CC-BY}}


CreativeCommonsBy.png This copyrighted material is licensed under a Creative Commons Attribution 4.0 International License. Follow the link to learn more.


PDFInclude

<pdf>http://steipe.biochemistry.utoronto.ca/abc/CourseMaterials/BCH441/02-SequenceData_2014.pdf</pdf>
<pdf width="300px" height="400px">http://steipe.biochemistry.utoronto.ca/abc/CourseMaterials/BCH441/02-SequenceData_2014.pdf</pdf>


Math markup

<math>H = - \sum_{i=0}^n p_i \log_{2} p_i</math>


Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H = - \sum_{i=0}^n p_i \log_{2} p_i}

see: http://meta.wikimedia.org/wiki/Help:Formula


Inserting a Web-site box

Boxes for Web site summaries, image and abstract

{{WWW|WWW_UniProt}} 
UniProt
link ] [ page ] UniProt is the protein sequence database of the European Bioinformatics Institute. It is an extraordinarily well constructed, curated, and integrated resource. As a public resource, its results are freely accessible world-wide. The "Knowledge Base" (UniProtKB), which is the database proper, contains two subsections: SwissProt, the manually curated and heavily annotated protein sequence repository; it is approximately equivalent to the NCBI Refseq protein database, albeit with usually higher annotation levels. TrEMBL is much larger and contains sequences that have been computationally translated from the EMBL nucleotide sequence collection. It is approximately equivalent to the NCBI's Entrez protein database. The URL links to the entry for the Saccharomyces cerevisiae cell-cycle regulation transcription factor Mbp1.
size=200px


Inserting an emphasis box

<div class="emphasis-box">Getting the data model right is the key to eternal bliss.</div>
Getting the data model right is the key to eternal bliss.


 

Inserting a Web-link box

<div class="reference-box">[http://www.ncbi.nlm.nih.gov '''The NCBI''']</div>

Linking text to R documentation

    Code   Result
base function only:   {{R|mean()}}   mean()
base function with different linked text:   {{R|mean()|the '''mean()''' function}}   the mean() function
package (note: no parentheses ):   {{R|knitr}}   knitr
function in non-base package:   {{R|graphics|par()}}   par()
function with different text:   {{R|grDevices|colorRamp()|colorRampPalette()}}   colorRampPalette()


Create link to online R documentation. If a name is followed by () it's a function, otherwise a package. If a package is given alone, link to the package documentation, otherwise to the package/function page. The base package is default, other packages can be chosen with the template's second parameter. If a third parameter is present, that will be the linked text. All documentation is pulled from rdocumentation.org and this should include CRAN as well as bioconductor packages.

Linking text to Wikipedia

{{WP|Mutual information|'''Mutual Information'''}}

Mutual Information

Collapsible elements

See: Manual: Collapsible elements

<div class="mw-collapsible mw-collapsed" data-expandtext="Expand" data-collapsetext="Collapse" style="width:50%; ">
* Visible text  
<div class="mw-collapsible-content" style="padding:10px;">
* Collapsed text 1
* Collapsed text 2
* Collapsed text 3
</div>
</div>
 
The Road Not Taken    Robert Frost

Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
 
Then took the other, as just as fair,
And having perhaps the better claim
Because it was grassy and wanted wear,
Though as for that the passing there
Had worn them really about the same,
 
And both that morning equally lay
In leaves no step had trodden black.
Oh, I marked the first for another day!
Yet knowing how way leads on to way
I doubted if I should ever come back.
 
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference.