Open main menu

Changes

1,128 bytes added ,  15:36, 2 July 2012
→‎In-line elements: Add code and key templates
== In-line elements ==
----
=== ConTeXt commands ===
Use the following markup [[Template:cmd|cmd template]] for command names in running text:
* <nowiki>{{cmd|mycommand}}</nowiki>,
* <nowiki>{{cmd|mycommand|parameters, text, etc.}}</nowiki>
|- style="vertical-align: top"
|
* <tt><nowiki>{{cmd|startitemize}}</nowiki></tt>* <tt><nowiki>{{cmd|startnarrower|[middle]}}</nowiki></tt>* <tt><nowiki>{{cmd|startcolumns|2=[n=4]}}</nowiki></tt>* <tt><nowiki>{{cmd|section|{First section}}}</nowiki></tt>
|
* {{cmd|startitemize}}
* {{cmd|startnarrower|[middle]}}
* {{cmd|startcolumns|2=[n=4]}}
* {{cmd|section|{First section}}}
|-
| Forgetting the pipe or the '2=' leads to this:* <tt><nowiki>{{cmd|startnarrower[middle]}}</nowiki></tt>* <tt><nowiki>{{cmd|startcolumns|[n=4]}}</nowiki></tt>* <tt><nowiki>{{cmd|section{First section}}}</nowiki></tt>
|
* {{cmd|startnarrower[middle]}}
* {{cmd|startcolumns|[n=4]}}
* {{cmd|section{First section}}}
|}
=== 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 you should be turned it into <nowiki>{{cmd|somecommand}}</nowiki> wherever you see it. === Linking to parameter description pages === In ConTeXt many {{code|1=key=value}} parameters are common across commands, so this wiki intends to have separate description pages for those parameters. Those are not linked from the text, in general, but they are linked from the syntax tables on command description pages. ([[Command/setupframed|Example]].) The linking is achieved with <nowiki>{{key|alternative}}</nowiki>, which expands to [[Command/keyword:alternative|<nowiki>[[Command/keyword:alternative]]</nowiki>]]. Nearly all the target pages do not exist yet.
=== Other inline code ===
For in-line markup of code, commands, parameters, etc. in running text use <ttnowiki>&lt;{{code|some code}}</nowiki>. If there are equality signs in the code&gt; , use e.g.<nowiki>{{code|1=some=code}}</nowiki>, because the wiki templating software interprets all text up to the first equality sign as a template parameter name. Please do use the {{code|code}} template instead of the {{code|&lt;/code&gt;</tt>}} tags, as templates are much easier to change.
{| class=wikitable
In the following examples we use the
{{cmd|framed}} command with the
parameters <{{code>|1=background=color</code> }} and <{{code>|1=offset=1cm</code>}}.
</xmlcode>
| style="background-color: white" |
In the following examples we use the {{cmd|framed}} command
with the parameters <{{code>|1=background=color</code> }} and <{{code>|1=offset=1cm</code>}}.
|}
=== Linking to source files ===
Practically all of ConTeXt's source files are stored in the directory <{{code>|/tex/context/base</code>}}. There are two templates to link to online versions of the source file.
Link to the most recent version (recommended):
* '''Links to:''' http://modules.contextgarden.net/t-lettrine
* '''Looks like:''' [[modules:t-bnf|Lettrine module]]
 
== Block elements ==