Changes

Jump to navigation Jump to search
1,568 bytes added ,  14:25, 14 June 2012
Big reorganization, and add a few of the new snippets and conventions.
Most of the following markup on this help page is specific for contextgarden. So, read on!
== In-line elements ==
== Pretty printing ==You can use references to other garden projects. Use the following syntax to create links to the other contextgarden projects:
* <code><nowiki>'''Bold text'''</nowiki></code> -- '''Bold text'''* <code><nowiki>''Italic text''</nowiki></code> -- ''Italic text''* <code><nowiki>----</nowiki></code> draws a horizonal rule=== ConTeXt commands ===
=== In-line elements ===Use the following markup for command names in running text: ----'''* <codenowiki>{{cmd|mycommand}}</nowiki>, * <codenowiki>{{cmd|mycommand|parameters, text, etc.}}</nowiki></code>'''That way, you get an automatic link to e.g. {{cmd|startnarrower}}, or {{cmd|startnarrower|[middle]}}.
For in{| class=wikitable! scope=col width=360 style="text-line markup of code, commands, parameters, etc. in the running align: left"| You type! scope=col width=360 style="text use -align: left"| You see|- style="vertical-align: top"| * <nowiki>{{cmd|startitemize}}</nowiki></code>* <nowiki>{{cmd|startnarrower|[middle]}}</nowiki>* <codenowiki> ... {{cmd|section|{First section}}}</codenowiki>| * {{cmd|startitemize}}* {{cmd|startnarrower|[middle]}}* {{cmd|section|{First section}}}|-| Forgetting the pipe leads to this:* <nowiki>{{cmd|startnarrower[middle]}}</nowiki>* <nowiki>{{cmd|section{First section}}}</codenowiki>.| * {{cmd|startnarrower[middle]}}* {{cmd|section{First section}}}|}
''wiki markup''=== The &lt;cmd&gt; tag is deprecated. ===
Sometimes, when editing an older page, you will see &lt;cmd&gt;\somecommand&lt;/cmd&gt; on this wiki. This is an older, deprecated form, and should be turned into <nowiki>{{cmd|somecommand}}</nowiki> wherever you see it. === Other inline code === For in-line markup of code, commands, parameters, etc. in running text use <tt>&lt;code&gt; ... &lt;/code&gt;</tt>. {| class=wikitable! scope=col width=360 style="text-align: left"| You type! scope=col width=360 style="text-align: left"| You see|- style="vertical-align: top"| <xmlcode>In the following examples we use <code>\the {{cmd|framed</code> }} command with the parameters <code>background=color</code> and <code>offset=1cm</code>.
</xmlcode>
''wiki display''| style="background-color: white" |In the following examples we use the {{cmd|framed}} command with the parameters <code>background=color</code> and <code>offset=1cm</code>.|} === Linking to source files ===
In Practically all of ConTeXt's source files are stored in the following examples we use directory <code>\framed</code> command with the parameters <code>background=color<tex/context/code> and <code>offset=1cmbase</code>.----There are two templates to link to online versions of the source file.
=== Block elements ===----Link to the most recent version (recommended):* '''You type:'''<code><nowiki><pre>{{src|type-akb.tex}}</nowiki><* '''Links to:''' http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/code>type-akb.tex* '''Looks like:'''{{src|type-akb.tex}}
To dispay verabtim text use <code>Link to the version stored on contextgarden.net:* '''You type:''' <nowiki><pre> .[[source:type-akb.tex| type-akb. tex]]</prenowiki><* '''Links to:''' http://nowiki><source.contextgarden.net/code>type-akb.tex* '''Looks like:''' [[source:type-akb.tex|type-akb.tex]]
''=== Linking to other sections of the wiki markup''===
* '''You type:''' <xmlcodenowiki>[[modules:t-lettrine|Lettrine module]]<pre/nowiki>This is an announcement from the mailing list with some code* '''Links to:''' http://modules.contextgarden.net/t-lettrine* '''Looks like:''' [[modules:t-bnf|Lettrine module]]
\unprotect\def\!test{alfa} \protect </pre></xmlcode>== Block elements ==
''wiki display''=== Displaying ConTeXt output (and source) ===
<pre>This is an announcement from wiki allows you to type ConTeXt code to obtain a PNG of the mailing list resultant output, with some codeextraneous whitespace cropped. This is very useful for including in-page examples. Below are two simple ones; for more, see [[Help:Context]].
{| class=wikitable! scope=col width=300 style="text-align: left"| You type! scope=col width=300 style="text-align: left"| You see|- style="vertical-align: top"| <pre><context>The wiki uses ConTeXt version: \crlf\contextversionnumber</context></pre>| <context>The wiki uses ConTeXt version: \unprotectcrlf\defcontextversionnumber</context>|- style="vertical-align: top"| <pre><context source=yes mode=mkiv text="This produces:">The wiki uses ConTeXt version: \!test{alfa} crlf\protect contextversionnumber</context>
</pre>
| <context source=yes mode=mkiv text="This produces:">
The wiki uses ConTeXt version: \crlf
\contextversionnumber
</context>
|}
----'''<=== Displaying TeX or ConTeXt code><nowiki><texcode></nowiki></code>'''alone ===
For displaying TeX an and ConTeXt source use <code><nowiki><texcode> ... </texcode></nowiki></code>.
''wiki markup''{| class=wikitable! scope=col width=360 style="text-align: left"| You type! scope=col width=360 style="text-align: left"| You see|- style="vertical-align: top"| <xmlcodepre>
<texcode>
\def\person#1#2{{\em #1 (#2)}}
offset=1cm ]{hello world!}
</texcode>
</xmlcodepre''wiki display'' | <texcode>
\def\person#1#2{{\em #1 (#2)}}
offset=1cm ]{hello world!}
</texcode>
----|}
'''<code><nowiki><xmlcode></nowiki></code>'''=== Displaying XML ===
For presenting XML source use <code><nowiki><xmlcode> ... </xmlcode></nowiki></code>.
''wiki markup''{| class=wikitable! scope=col width=360 style="text-align: left"| You type! scope=col width=360 style="text-align: left"| You see|- style="vertical-align: top"| <xmlcodepre>
&lt;xmlcode>
<?xml version="1.0"?>
</TeXML>
&lt;/xmlcode>
</xmlcodepre''wiki display'' | <xmlcode>
<?xml version="1.0"?>
<TeXML>
</TeXML>
</xmlcode>
|}
----=== Displaying other verbatim text ===
'''To dispay other verbatim text use <code><nowiki><contextpre> ... </pre></nowiki></code>'''.
Nice local feature of contextgarden allows you to run ConTeXt on the fly {| class=wikitable! scope=col width=360 style="text-align: left"| You type! scope=col width=360 style="text-align: left"| You see|- style="vertical-align: top"| <pre><pre>This is some text and the wiki page will include the result of the eneterd some code in the page. See also http://live.contextgarden.net/ for an online ConTeXt.
''wiki markup''\unprotect\def\!test{alfa} \protect &lt;/pre></pre>
| <xmlcodepre><context>\setupcolors [state=start]\framed [background=color, backgroundcolor=green, offset=1cm ]{hello world!}</context></xmlcode>This is some text and some code.
''wiki display'' <context>\unprotect\setupcolors [state=start]def\framed [background=color, backgroundcolor=green, offset=1cm ]{hello world!}</context>---- '''<code>source="yes"</code>''' If you add <code>source="yes"</code> to the <code><nowiki><context></nowiki></code> tag, you have the source and the result displayed. The contents of the attribute <code>text</code> will be inserted between the text and the result. ''wiki markup'' <xmlcode><context source="yes" text="produces">\setupcolors [state=start]\framed [background=color, backgroundcolor=green, offset=1cm ]test{hello world!alfa}</context></xmlcode> ''wiki display'' <context source="yes" text="produces">\setupcolors [state=start]\framed [background=color, backgroundcolor=green, offset=1cm ]{hello world!}protect </context>---- == Links == You can use references to other garden projects. Use the following syntax to create links to the other contextgarden projects: <pre><nowiki> [[source:type-akb.tex| type-akb.tex]] [[modules:t-bnf| bnf module]] {{cmd|goto}} </nowiki></pre> Looks like:* [[source:type-akb.tex| type-akb.tex]] -- source files of ConTeXt* [[modules:t-bnf| bnf module]] -- [http://modules.contextgarden.net third party modules]* {{cmd|goto}} -- links to the definition of the command

Navigation menu