Difference between revisions of "Wiki:Editing"

From Wiki
Jump to navigation Jump to search
({{About this wiki navbox}})
(24 intermediate revisions by 9 users not shown)
Line 1: Line 1:
'''For Formatting help see [http://www.mediawiki.org/wiki/Help:Formatting www.mediawiki.org/wiki/Help:Formatting]'''
+
''This page is about editing pages on this wiki in general. For editing command reference pages, also see [[Help:Command reference]].''
  
 
== General ==
 
== General ==
Line 5: Line 5:
 
=== May I edit pages without signing in? ===
 
=== May I edit pages without signing in? ===
  
Yes, you may (mainly because we are still glad if the users who hate signing in can nevertheless contribute), but you are highly <b>discouraged</b> to do so. Please, sign in before contributing if possible. Even if you use a username/nickname with no resemblance to your real name, this is still better than not signing in at all.
+
Yes, but you are <b>highly encouraged</b> 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? ===
+
=== What commands do I use to edit this wiki? ===
  
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.
+
In order of increasing generality, have a look at:
 +
* Mediawiki's [http://www.mediawiki.org/wiki/Help:Formatting guide to formatting]
 +
* Mediawiki's [http://meta.wikimedia.org/wiki/Help:Editing guide to editing in general]
 +
* [http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide Mediawiki User Guide]
 +
* There are some special commands and templates available on this wiki; they are described on the rest of this page.
  
 
=== How do I sign when posting a comment? ===
 
=== How do I sign when posting a comment? ===
  
* <code><nowiki>~~~</nowiki></code> will expand into <nowiki>[[User:Yourusername|Yournickname]]</nowiki>, so basically your <b>nickname</b> will be shown
+
* '''You type:''' <code><nowiki>--~~~</nowiki></code> (three tildes)
* <code><nowiki>~~~~</nowiki></code> will also add a <b>timestamp</b> next to your nickname
+
* '''Looks like:''' --[[User:Esteis|Esteis]]
 
 
So you will usually write <code><nowiki>--~~~</nowiki></code> or <code><nowiki>--~~~~</nowiki></code>
 
  
--[[Special:Contributions/174.101.111.175|174.101.111.175]] 08:11, 16 May 2010 (UTC)Sarah Rose Burch was here.
+
* '''You type:''' <code><nowiki>--~~~~</nowiki></code> (four tildes)
 +
* '''Looks like:''' --[[User:Esteis|Esteis]] 16:37, 14 June 2012 (CEST)
  
            && She likes it rough.
+
=== How do I edit the Main Page? ===
Ooh yeah.
 
  
                                  If you are a hot lady then hit this chick up!
+
The Main 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.
 
 
  (: Yeaah. Click below.
 
  
        http://www.facebook.com/?ref=logo#!/profile.php?id=843257113
+
== In-line elements ==
 
                                                                    Just so you know, yeah. She wants you hot babes.
 
 
 
    She likes to eat pickles in her spare time!
 
  
                                                      &&She likes sweet & sour sauce to spice up her bedroom.
+
=== ConTeXt commands ===
  
== Pretty printing ==
+
Use the [[Template:cmd|cmd template]] 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]}}.
  
* <code><nowiki>'''Bold text'''</nowiki></code> -- '''Bold text'''
+
{| class=wikitable
* <code><nowiki>''Italic text''</nowiki></code> -- ''Italic text''
+
! scope=col width=360 style="text-align: left"| You type
* <code><nowiki>----</nowiki></code> draws a horizonal rule
+
! scope=col width=360 style="text-align: left"| You see
 +
|- 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}}}
 +
|}
  
=== In-line elements ===
+
=== The &lt;cmd&gt; tag is deprecated. ===
----
 
'''<code><nowiki><code></nowiki></code>'''
 
  
For in-line markup of code, commands, parameters, etc. in the running text use <code><nowiki><code> ... </code></nowiki></code>.
+
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 turned it into <nowiki>{{cmd|somecommand}}</nowiki> wherever you see it.
  
''wiki markup''
+
=== Linking to parameter description pages ===
  
<xmlcode>
+
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, but don't let that stop you from linking to them. We'll get around to filling them in.
In the following examples we use <code>\framed</code> command with the parameters <code>background=color</code> and <code>offset=1cm</code>.
+
 
 +
=== Other inline code ===
 +
 
 +
For in-line markup of code, commands, parameters, etc. in running text use <nowiki>{{code|some code}}</nowiki>. If there are equality signs in the code, 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>}} tags, as templates are much easier to change.
 +
 
 +
{| 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|1=background=color}}
 +
and {{code|1=offset=1cm}}.
 
</xmlcode>
 
</xmlcode>
  
''wiki display''
+
| style="background-color: white" |
 +
In the following examples we use the {{cmd|framed}} command
 +
with the parameters {{code|1=background=color}} and
 +
{{code|1=offset=1cm}}.
 +
|}
  
In the following examples we use <code>\framed</code> command with the parameters <code>background=color</code> and <code>offset=1cm</code>.
+
=== Linking to source files ===
----
 
  
=== Block elements ===
+
Practically all of ConTeXt's source files are stored in the directory {{code|.../tex/context/base}}. There are two templates to link to online copies of the source files.
----
 
'''<code><nowiki><pre></nowiki></code>'''
 
  
To dispay verabtim text use <code><nowiki><pre> ... </pre></nowiki></code>.
+
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}}
  
''wiki markup''
+
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]]
  
<xmlcode>
+
=== Linking to other sections of the wiki ===
<pre>
+
 
This is an announcement from the mailing list with some code.
+
* '''You type:''' <nowiki>[[modules:t-lettrine|Lettrine module]]</nowiki>
 +
* '''Links to:''' http://modules.contextgarden.net/t-lettrine
 +
* '''Looks like:''' [[modules:t-bnf|Lettrine module]]
  
\unprotect
+
== Block elements ==
\def\!test{alfa}
 
\protect
 
</pre>
 
</xmlcode>
 
  
''wiki display''
+
=== Displaying ConTeXt output (and source) ===
  
<pre>
+
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]]. When using MkIV, it is good practice to include a comment {{code|1=% mode=mkiv}}: otherwise, the reader will have no indication that the example is compiled with MkIV instead of the usual MkII.
This is an announcement from the mailing list with some code.
 
  
\unprotect
+
{| class=wikitable
\def\!test{alfa}
+
! scope=col width=300 style="text-align: left"| You type
\protect
+
! scope=col width=300 style="text-align: left"| You see
 +
|- style="vertical-align: top"
 +
| <pre>
 +
<context>
 +
The wiki's default is ConTeXt Mark II: \crlf
 +
\contextversionnumber
 +
</context>
 +
</pre>
 +
| <context>
 +
The wiki's default is ConTeXt Mark II: \crlf
 +
\contextversionnumber
 +
</context>
 +
|- style="vertical-align: top"
 +
| <pre>
 +
<context source=yes mode=mkiv text="This produces:">
 +
% mode=mkiv
 +
The wiki also uses ConTeXt Mark IV: \crlf
 +
\contextversionnumber
 +
</context>
 
</pre>
 
</pre>
 +
| <context source=yes mode=mkiv text="This produces:">
 +
% mode=mkiv
 +
The wiki also uses ConTeXt Mark IV: \crlf
 +
\contextversionnumber
 +
</context>
 +
|}
  
----
+
=== Displaying TeX or ConTeXt code alone ===
'''<code><nowiki><texcode></nowiki></code>'''
 
  
For displaying TeX an ConTeXt source use <code><nowiki><texcode> ... </texcode></nowiki></code>.
+
For displaying TeX and ConTeXt code use <code><nowiki><texcode> ... </texcode></nowiki></code>.
  
''wiki markup''
+
{| class=wikitable
 
+
! scope=col width=360 style="text-align: left"| You type
<xmlcode>
+
! 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 103: Line 164:
 
         offset=1cm ]{hello world!}
 
         offset=1cm ]{hello world!}
 
</texcode>
 
</texcode>
</xmlcode>
+
</pre>
 
+
| <texcode>
''wiki display''
 
 
 
<texcode>
 
 
\def\person#1#2{{\em #1 (#2)}}
 
\def\person#1#2{{\em #1 (#2)}}
  
Line 115: Line 173:
 
         offset=1cm ]{hello world!}
 
         offset=1cm ]{hello world!}
 
</texcode>
 
</texcode>
----
+
|}
  
'''<code><nowiki><xmlcode></nowiki></code>'''
+
=== Displaying XML ===
  
 
For presenting XML source use <code><nowiki><xmlcode> ... </xmlcode></nowiki></code>.
 
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
<xmlcode>
+
! scope=col width=360 style="text-align: left"| You see
 +
|- style="vertical-align: top"
 +
| <pre>
 
&lt;xmlcode>
 
&lt;xmlcode>
 
<?xml version="1.0"?>
 
<?xml version="1.0"?>
Line 132: Line 192:
 
</TeXML>
 
</TeXML>
 
&lt;/xmlcode>
 
&lt;/xmlcode>
</xmlcode>
+
</pre>
 
+
| <xmlcode>
''wiki display''
 
 
 
<xmlcode>
 
 
<?xml version="1.0"?>
 
<?xml version="1.0"?>
 
<TeXML>
 
<TeXML>
Line 144: Line 201:
 
</TeXML>
 
</TeXML>
 
</xmlcode>
 
</xmlcode>
 +
|}
  
----
+
=== Displaying other verbatim text ===
  
'''<code><nowiki><context></nowiki></code>'''
+
To dispay other verbatim text use <code><nowiki><pre> ... </pre></nowiki></code>.
  
Nice local feature of contextgarden allows you to run ConTeXt on the fly and the wiki page will include the result of the eneterd code in the page. See also http://live.contextgarden.net/ for an online ConTeXt.
+
{| 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.
  
''wiki markup''
+
\unprotect
 
+
\def\!test{alfa}  
<xmlcode>
+
\protect
<context>
+
&lt;/pre>
\setupcolors [state=start]
+
</pre>
\framed [background=color,
 
        backgroundcolor=green,
 
        offset=1cm ]{hello world!}
 
</context>
 
</xmlcode>
 
  
''wiki display''
+
| <pre>
 +
This is some text and some code.
  
<context>
+
\unprotect
\setupcolors [state=start]
+
\def\!test{alfa}  
\framed [background=color,
+
\protect
        backgroundcolor=green,
+
</pre>
        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 ]{hello world!}
 
</context>
 
</xmlcode>
 
 
 
''wiki display''
 
 
 
<context source="yes" text="produces">
 
\setupcolors [state=start]
 
\framed [background=color,
 
        backgroundcolor=green,
 
        offset=1cm ]{hello world!}
 
</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|\goto]]
 
</nowiki></pre>
 
  
Looks like:
+
{{About this wiki navbox}}
* [[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|\goto]] -- links to the definition of the command
 

Revision as of 20:52, 19 September 2012

This page is about editing pages on this wiki in general. For editing command reference pages, also see Help:Command reference.

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.

What commands do I use to edit this wiki?

In order of increasing generality, have a look at:

How do I sign when posting a comment?

  • You type: --~~~ (three tildes)
  • Looks like: --Esteis
  • You type: --~~~~ (four tildes)
  • Looks like: --Esteis 16:37, 14 June 2012 (CEST)

How do I edit the Main Page?

The Main 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.

In-line elements

ConTeXt commands

Use the cmd template 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
  • {{cmd|startitemize}}
  • {{cmd|startnarrower|[middle]}}
  • {{cmd|startcolumns|2=[n=4]}}
  • {{cmd|section|{First section}}}
Forgetting the pipe or the '2=' leads to this:
  • {{cmd|startnarrower[middle]}}
  • {{cmd|startcolumns|[n=4]}}
  • {{cmd|section{First section}}}
  • [[Command/startnarrower[middle]|\startnarrower[middle]]]
  • \startcolumns
  • [[Command/section{First section|\section{First section]]}

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 you should turned it into {{cmd|somecommand}} wherever you see it.

Linking to parameter description pages

In ConTeXt many 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. (Example.) The linking is achieved with {{key|alternative}}, which expands to [[Command/keyword:alternative]]. Nearly all the target pages do not exist yet, but don't let that stop you from linking to them. We'll get around to filling them in.

Other inline code

For in-line markup of code, commands, parameters, etc. in running text use {{code|some code}}. If there are equality signs in the code, use e.g. {{code|1=some=code}}, because the wiki templating software interprets all text up to the first equality sign as a template parameter name. Please do use the code template instead of the <code> tags, as templates are much easier to change.

You type You see
In the following examples we use the 
{{cmd|framed}} command with the 
parameters {{code|1=background=color}} 
and {{code|1=offset=1cm}}.

In the following examples we use the \framed command with the parameters background=color and offset=1cm.

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 copies of the source files.

Link to the most recent version (recommended):

Link to the version stored on contextgarden.net:

Linking to other sections of the wiki

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. When using MkIV, it is good practice to include a comment % mode=mkiv: otherwise, the reader will have no indication that the example is compiled with MkIV instead of the usual MkII.

You type You see
<context>
The wiki's default is ConTeXt Mark II: \crlf
\contextversionnumber
</context>
<context source=yes mode=mkiv text="This produces:">
% mode=mkiv
The wiki also uses ConTeXt Mark IV: \crlf
\contextversionnumber
</context>
% mode=mkiv
The wiki also uses ConTeXt Mark IV: \crlf
\contextversionnumber

This produces:

Displaying TeX or ConTeXt code alone

For displaying TeX and ConTeXt code 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