Difference between revisions of "Wiki:Editing"
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}") |
(Big reorganization, and add a few of the new snippets and conventions.) |
||
Line 26: | Line 26: | ||
Most of the following markup on this help page is specific for contextgarden. So, read on! | Most of the following markup on this help page is specific for contextgarden. So, read on! | ||
+ | == In-line elements == | ||
− | + | You can use references to other garden projects. Use the following syntax to create links to the other contextgarden projects: | |
− | + | === ConTeXt commands === | |
− | |||
− | |||
− | + | Use the following markup for command names in running text: | |
− | + | * <nowiki>{{cmd|mycommand}}</nowiki>, | |
− | + | * <nowiki>{{cmd|mycommand|parameters, text, etc.}}</nowiki> | |
+ | That way, you get an automatic link to e.g. {{cmd|startnarrower}}, or {{cmd|startnarrower|[middle]}}. | ||
− | + | {| 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" | ||
+ | | | ||
+ | * <nowiki>{{cmd|startitemize}}</nowiki></code> | ||
+ | * <nowiki>{{cmd|startnarrower|[middle]}}</nowiki> | ||
+ | * <nowiki>{{cmd|section|{First section}}}</nowiki> | ||
+ | | | ||
+ | * {{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}}}</nowiki> | ||
+ | | | ||
+ | * {{cmd|startnarrower[middle]}} | ||
+ | * {{cmd|section{First section}}} | ||
+ | |} | ||
− | + | === The <cmd> tag is deprecated. === | |
− | <xmlcode> | + | Sometimes, when editing an older page, you will see <cmd>\somecommand</cmd> on this wiki. This is an older, deprecated form, and should be turned into <nowiki>{{cmd|somecommand}}</nowiki> wherever you see it. |
− | In the following examples we use | + | |
+ | === Other inline code === | ||
+ | |||
+ | For in-line markup of code, commands, parameters, etc. in running text use <tt><code> ... </code></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 the | ||
+ | {{cmd|framed}} command with the | ||
+ | parameters <code>background=color</code> | ||
+ | and <code>offset=1cm</code>. | ||
</xmlcode> | </xmlcode> | ||
− | + | | 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 === | ||
− | + | 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): | |
− | + | * '''You type:''' <nowiki>{{src|type-akb.tex}}</nowiki> | |
− | ''' | + | * '''Links to:''' http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/type-akb.tex |
+ | * '''Looks like:''' {{src|type-akb.tex}} | ||
− | + | Link to the version stored on contextgarden.net: | |
+ | * '''You type:''' <nowiki>[[source:type-akb.tex| type-akb.tex]]</nowiki> | ||
+ | * '''Links to:''' http://source.contextgarden.net/type-akb.tex | ||
+ | * '''Looks like:''' [[source:type-akb.tex|type-akb.tex]] | ||
− | + | === Linking to other sections of the wiki === | |
− | < | + | * '''You type:''' <nowiki>[[modules:t-lettrine|Lettrine module]]</nowiki> |
− | < | + | * '''Links to:''' http://modules.contextgarden.net/t-lettrine |
− | + | * '''Looks like:''' [[modules:t-bnf|Lettrine module]] | |
− | + | == Block elements == | |
− | |||
− | |||
− | |||
− | |||
− | + | === Displaying ConTeXt output (and source) === | |
− | + | This wiki allows you to type ConTeXt code to obtain a PNG of the resultant output, with extraneous whitespace cropped. This is very useful for including in-page examples. Below are two simple ones; for more, see [[Help:Context]]. | |
− | This | ||
− | \ | + | {| 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: \crlf | ||
+ | \contextversionnumber | ||
+ | </context> | ||
+ | |- style="vertical-align: top" | ||
+ | | <pre> | ||
+ | <context source=yes mode=mkiv text="This produces:"> | ||
+ | The wiki uses ConTeXt version: \crlf | ||
+ | \contextversionnumber | ||
+ | </context> | ||
</pre> | </pre> | ||
+ | | <context source=yes mode=mkiv text="This produces:"> | ||
+ | The wiki uses ConTeXt version: \crlf | ||
+ | \contextversionnumber | ||
+ | </context> | ||
+ | |} | ||
− | + | === Displaying TeX or ConTeXt code alone === | |
− | |||
− | For displaying TeX | + | For displaying TeX and ConTeXt source use <code><nowiki><texcode> ... </texcode></nowiki></code>. |
− | + | {| 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> | ||
<texcode> | <texcode> | ||
\def\person#1#2{{\em #1 (#2)}} | \def\person#1#2{{\em #1 (#2)}} | ||
Line 94: | Line 153: | ||
offset=1cm ]{hello world!} | offset=1cm ]{hello world!} | ||
</texcode> | </texcode> | ||
− | </ | + | </pre> |
− | + | | <texcode> | |
− | |||
− | |||
− | <texcode> | ||
\def\person#1#2{{\em #1 (#2)}} | \def\person#1#2{{\em #1 (#2)}} | ||
Line 106: | Line 162: | ||
offset=1cm ]{hello world!} | offset=1cm ]{hello world!} | ||
</texcode> | </texcode> | ||
− | + | |} | |
− | + | === Displaying XML === | |
For presenting XML source use <code><nowiki><xmlcode> ... </xmlcode></nowiki></code>. | For presenting XML source use <code><nowiki><xmlcode> ... </xmlcode></nowiki></code>. | ||
− | + | {| 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> | ||
<xmlcode> | <xmlcode> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
Line 123: | Line 181: | ||
</TeXML> | </TeXML> | ||
</xmlcode> | </xmlcode> | ||
− | </ | + | </pre> |
− | + | | <xmlcode> | |
− | |||
− | |||
− | <xmlcode> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
<TeXML> | <TeXML> | ||
Line 135: | Line 190: | ||
</TeXML> | </TeXML> | ||
</xmlcode> | </xmlcode> | ||
+ | |} | ||
− | + | === Displaying other verbatim text === | |
− | + | To dispay other verbatim text use <code><nowiki><pre> ... </pre></nowiki></code>. | |
− | + | {| 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 some code. | ||
− | + | \unprotect | |
+ | \def\!test{alfa} | ||
+ | \protect | ||
+ | </pre> | ||
+ | </pre> | ||
− | < | + | | <pre> |
− | + | This is some text and some code. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | \unprotect | |
− | + | \def\!test{alfa} | |
− | + | \protect | |
− | \ | + | </pre> |
− | \ | + | |} |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | \ | ||
− | |||
− | |||
− | </ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 14:25, 14 June 2012
For Formatting help see www.mediawiki.org/wiki/Help:Formatting
Contents
General
May I edit pages without signing in?
Yes, but you are highly encouraged to sign in before contributing if possible. Even if your account has a username/nickname with no resemblance to your real name, this is still better than not signing in at all while editing.
How do I edit the first page?
First page is protected to avoid spammers. However, you can still edit it (let's hope for stupid spammers). Type Template:Main Page after contextgarden.net/ and edit that template.
How do I sign when posting a comment?
~~~
will expand into [[User:Yourusername|Yournickname]], so basically your nickname will be shown~~~~
will also add a timestamp next to your nickname
So you will usually write --~~~
or --~~~~
What are the other commands to edit this wiki?
The markup used in this wiki is a general MediaWiki markup and is described in the MediaWiki User Guide (esp. http://meta.wikimedia.org/wiki/Help:Editing ).
Most of the following markup on this help page is specific for contextgarden. So, read on!
In-line elements
You can use references to other garden projects. Use the following syntax to create links to the other contextgarden projects:
ConTeXt commands
Use the following markup for command names in running text:
- {{cmd|mycommand}},
- {{cmd|mycommand|parameters, text, etc.}}
That way, you get an automatic link to e.g. \startnarrower, or \startnarrower[middle].
You type | You see |
---|---|
|
|
Forgetting the pipe leads to this:
|
|
The <cmd> tag is deprecated.
Sometimes, when editing an older page, you will see <cmd>\somecommand</cmd> on this wiki. This is an older, deprecated form, and should be turned into {{cmd|somecommand}} wherever you see it.
Other inline code
For in-line markup of code, commands, parameters, etc. in running text use <code> ... </code>.
You type | You see |
---|---|
In the following examples we use the {{cmd|framed}} command with the parameters <code>background=color</code> and <code>offset=1cm</code>. |
In the following examples we use the \framed command
with the parameters |
Linking to source files
Practically all of ConTeXt's source files are stored in the directory /tex/context/base
. There are two templates to link to online versions of the source file.
Link to the most recent version (recommended):
- You type: {{src|type-akb.tex}}
- Links to: http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/type-akb.tex
- Looks like: type-akb.tex
Link to the version stored on contextgarden.net:
- You type: [[source:type-akb.tex| type-akb.tex]]
- Links to: http://source.contextgarden.net/type-akb.tex
- Looks like: type-akb.tex
Linking to other sections of the wiki
- You type: [[modules:t-lettrine|Lettrine module]]
- Links to: http://modules.contextgarden.net/t-lettrine
- Looks like: Lettrine module
Block elements
Displaying ConTeXt output (and source)
This wiki allows you to type ConTeXt code to obtain a PNG of the resultant output, with extraneous whitespace cropped. This is very useful for including in-page examples. Below are two simple ones; for more, see Help:Context.
You type | You see |
---|---|
<context> The wiki uses ConTeXt version: \crlf \contextversionnumber </context> |
|
<context source=yes mode=mkiv text="This produces:"> The wiki uses ConTeXt version: \crlf \contextversionnumber </context> |
The wiki uses ConTeXt version: \crlf \contextversionnumber This produces:
|
Displaying TeX or ConTeXt code alone
For displaying TeX and ConTeXt source use <texcode> ... </texcode>
.
You type | You see |
---|---|
<texcode> \def\person#1#2{{\em #1 (#2)}} \setupcolors [state=start] \framed [background=color, backgroundcolor=green, offset=1cm ]{hello world!} </texcode> |
\def\person#1#2{{\em #1 (#2)}} \setupcolors [state=start] \framed [background=color, backgroundcolor=green, offset=1cm ]{hello world!} |
Displaying XML
For presenting XML source use <xmlcode> ... </xmlcode>
.
You type | You see |
---|---|
<xmlcode> <?xml version="1.0"?> <TeXML> <env name="text"> Hello World </env> </TeXML> </xmlcode> |
<?xml version="1.0"?> <TeXML> <env name="text"> Hello World </env> </TeXML> |
Displaying other verbatim text
To dispay other verbatim text use <pre> ... </pre>
.
You type | You see |
---|---|
<pre> This is some text and some code. \unprotect \def\!test{alfa} \protect </pre> |
This is some text and some code. \unprotect \def\!test{alfa} \protect |