Changes

Jump to navigation Jump to search
2,589 bytes added ,  18:48, 5 September 2020
m
typo
{{todo|This page documents the situation that will become active in a few hours when a newly developed wiki extension will be ported over from the test wiki. This page is written in preparation. Soon, this todo block will be deleted.
 
[[User:Taco|Taco]] ([[User talk:Taco|talk]]) 13:05, 20 August 2020 (CEST)}}
== ConTeXt command reference ==
=== Generated commands and environments ===
In ConTeXt, some commands and environments are created by use of another command, typically by a command whose name starts with `\define...`. Users are free to define their own commands and environments that way, but some such are in fact predefined by ConTeXt itself. Examples are {{cmd|startchapter}}, which is defined using {{cmd|definesection|[chapter]}}, and {{cmd|startitemize}}, which is defined using {{cmd|defineitemgroup|[itemize]}}.
In the xml XML documentation generated commands like {{cmd|startchapter}} and {{cmd|startsubject}} are grouped together, because all commands generated by {{cmd|definesection}} have the exact same parameters and options.
To mimic this on the wiki, for generated commands there is a single page for the group. For such these group pages, the page name starts with an underscore. For the sectioning example, that is `/Command/_startsection`. There are also the pages `/Command/startchapter` ({{cmd|startchapter}}) and `/Command/startsubject` ({{cmd|startsubject}}), but these are intended to be just redirect pages to `/Command/_startsection` ({{cmd|_startsection}}).
As you can see above, Using the {{tl|cmd}} template for referring to the group pages looks a bit weird (`<nowiki>{{cmd|_startsection}}</nowiki>` was given) which is why there is a separate template for referring to those group pages: {{tl|gen}}. `<nowiki>{{gen|startsection}}</nowiki>` produces: {{gen|startsection}}.
== Page stucture structure ==
The structure of the new command pages is always the same:
| '''Forum help''' || A list of quick-links to community searches.
|}
 
=== The syntax table in '''Settings''', in detail ===
 
A table that is set up along the following lines.
 
<table cellspacing="4" cellpadding="2" class="cmd">
<tr>
<td colspan="2" class="cmd">\XXX<!--
--><span class="first">[...]</span><!--
--><span class="second">[...]</span><!--
--><span class="third">[...]</span><!--
--></td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[...]</td>
<td>''text''</td>
</tr>
<tr valign="top" class="second">
<td class="cmd">key</td>
<td>'''default''' variant other</td>
</tr>
<tr valign="top" class="third">
<td class="cmd">[...]</td>
<td>''text''</td>
</tr>
</table>
 
Let us examine the following example:
 
<syntax>placefloat</syntax>
 
You would not normally type {{cmd|placefloat}} in your TeX-text, but rather a previously defined kind of float (<tt>figure</tt>, for example). If you '''did''' use {{cmd|placefloat}} literally, then the first argument would be the name of the predefined kind of float, like <tt>figure</tt>.
 
But normally, the command to use in a document would be {{cmd|placefigure}}:
 
<syntax>placefigure</syntax>
 
The first two arguments of {{cmd|placefigure}} are optional (recognisable because they are slanted), the second two are mandatory. The first optional argument takes one of the keywords mentioned in {{cmd|placefloat}}. If the argument is not given, then it uses the keyword in bold (assuming there is one). <tt>reference</tt> stands for a reference label; just insert a name that you want to refer to later. In the third and fourth argument ''text'' is in ''italics'' (to indicate that it is not the keyword '''text''', which does exist). Rather, it is a (terse) description of what you can enter. In this case, you can enter any kind of text. ''content'' is similar.
 
To get syntax tables like the ones above easily in a different page, add
 
<pre>
<syntax>placefloat</syntax>
</pre>
 
where you need it. This will fetch the relevant table(s) from the command database.
== Pre-existing pages ==
We of course want such pages to be converted into the new format. The recipe for that is:
* Move the existing page away to e.g. `/Command_old/setuphead` (this can be done via the `More` dropdown at the top of the page). <br/>Do Make sure you '''uncheck''not'the '' leave a redirect'' box, or you will first have to delete that redirect again using the `More` dropdown at the top of the page. The goal of the previous step is to make `Command/setuphead` temporarily be a 'Missing page', so that the extension can initialise it.* Now go to the `/Command/setuphead` url.<br/>If you followed a wiki link, it should automatically open the editor. Otherwise, click on the `Create` link.<br/>The edit screen will automatically be filled with an XML template a form that is suitable for the command you are editing.* If the Edit field remains emptyis missing but you see an error that states '''Command not found''', you are trying to document a no longer existing command, and you should stop editing and ask for advice on the mailing list.* If the Edit field contains a single `#REDIRECT` line this command that is generated (as explained above). Save the redirect, then continue with editing the `#REDIRECT` target page.* Open `/Command_old/setuphead` in a different browser window, and copy the documentation therein into the proper spots of the new `/Command/setuphead` page.* Save the new `/Command/setuphead`, and delete the `/Command_old/setuphead` page (this can also be done via the `More` dropdown at the top of the page) If you want to help: there are three pages with specifics about what needs to be checked, converted or added: * [[Document level commands work page]] (most important, especially the existing pages that should be converted)* [[Style level commands work page]] (somewhat less but still quite important)* [[System level commands work page]] (somewhat less but still quite important) When you have done some work, please update the relevant one of those three overview pages. Also, if you think it will take some time, place a remark in that overview page beforehand to let others know what you are working on.

Navigation menu