Changes

Jump to navigation Jump to search
4,802 bytes added ,  13:36, 10 August 2020
no edit summary
== Editing XML documentation ==
First off: '''Don't Panic!''' You do not have to use XML throughout! All user-supplied documentation can use wikicode wiki code just like on the rest of the wiki. You pages, you just have to be a little careful about where to put it. You '''never''' have to edit alter the pre-generated XML.
However, the goal of this documentation is to be easily exportable to other documentation efforts, so some care should be taken in deciding what the best way to add text. Here are some guidelines that may eventually even become enforced by the extension:
* Please '''do not''' add options to or delete portions of the pre-generated XML!
* Do not use block-level objects like subsections, lists, tables and figures except in the '''Description''' and '''Examples''' sections. Most documentation fields are intended to be used as running text.
* With the exception of {{tl|cmd}}, {{tl|gen}} and {{tl|todo}}, do not use wiki templates. Wiki templates can change over time, and that creates a nasty external dependency.
* Don't use regular HTML tags except for `<code><nowiki><pre></nowiki>` </code> (but `<code><nowiki><texcode></nowiki>` </code> is usually a better choice) and `<code><nowiki><code></nowiki>` (but backticks also work for that)</code>. For bold or italic text, use the regular [http://www.mediawiki.org/wiki/Help:Formatting wikicode markup].
* External links can be better placed in the '''See also''' section than in your main documentation.
* See below for a 'structural' way to refer to command parameters and options.
=== Editing the '''Summary''' === Simply finish or alter the sentence within the <code><cd:shortdesc></code> tag. The '''Summary''' should be a single sentence that gives a terse description of what the command does.  === Editing the '''Instances''' === Some commands have a separate section with the list of predefined instances of the command. You can add some documentation into the <code><cd:constant></code> tags of this instance list, if you believe that will be useful. === Editing the '''Settings''' === The '''Settings''' output is the Syntax table of the command or command variant, followed by a table listing the documented options. In a command with variants, there could be multiple '''Settings''' sections, with the variant name as the suffix to the title(s).  Not all options to every command actually need documentation, which is why the output only shows documented options. This helps keep the wiki page size within limits and helps the user maintain general overview. Adding documentation for a command is done by typing wiki text into one of the following XML tags: {|| <code><cd:assignmentsdoc></code> || For documentation that applies to all key-values of a parameter option|-| <code><cd:paramdoc></code> || For documentation that applies to all values of a specific key-value parameter|-| <code><cd:keywordsdoc></code> || For documentation that applies to all values of a keyword option|-| <code><cd:constant></code> || For documentation that applies to a specific key-value parameter value or a specific keyword|- |} For documentation that applies to arguments that are neither parameter nor keyword lists, you can put the documentation in the XML tag for the actual argument, for example in the <code><cd:content></code> of arguments 1 and 2 of {{todocmd|doifelse}}. === Editing the '''Description''' === Arguably the most important section for a command reference. If you want to put a heading in remember to start at level three (<code>===</code>) and don't forget that such sections cannot be finished edited separately within a Command page. If it becomes unwieldy, consider editing the text in a separate scratch area like the [[Special:MyTalk]] page, then pasting the complete edited text back in. === Editing the '''Examples''' === Each <code><cd:example></code> tag will create a level 3 heading. If you want to give it a specific title, fill in the <code>title</code> attribute. If you don't, examples will be numbered automatically as '''Example 1''', '''Example 2''', et cetera. As for '''Description''', don't forget that examples cannot be edited separately within a Command page. If it becomes unwieldy, consider editing the example in a separate scratch area like the [[Special:MyTalk]] page, then pasting the complete edited example back in. === Editing the '''Notes''' === Use a <code><cd:note></code> to report something that is not quite part of the regular command reference. For example, if you find a bug in this command in a specific ConTeXt version. You can fill in the <code>author</code> and <code>date</code> attributes manually, or use the shortcuts for signing a page: <pre><cd:note author="~~~" date="~~~~~">...</cd:note></pre> That is three tildes for the author name + link, and five tildes for the timestamp). Please do not edit other people's notes, create a new one if needed. === Editing the '''See also''' === This section is meant for cross-references that do not need to be in the actual '''Description''' or '''Settings''' documentation. Normally, a few values are pre-filled because the cross-reference was detected while creating the database record for this command. But it is not always easy to deduct cross-references from the original interface XML, so chances are that there are many more interesting links that the database generator has missed. Feel free to add any relevant links. If you want to add an explanatory text as well, you can key that in as the XML tag content. In case the comment containing the list of possible entries has been deleted from the record, here are the acceptable types: <pre><!-- one or more of these:<cd:commandref name="xx"></cd:commandref><cd:wikipage page="xx"></cd:wikipage><cd:url url="https://xx"></cd:url><cd:manual pdf="xx"></cd:manual><cd:source file="xx"></cd:source>--></pre> Fill in the <code>xx</code> with a suitable entry. Here are examples of the expected attribute values: <pre><cd:commandref name="contextversion"></cd:commandref><cd:wikipage page="Main Page"></cd:wikipage><cd:url url="https://www.pragma-ade.com"></cd:url><cd:manual pdf="xml-mkiv.pdf"></cd:manual><cd:source file="cont-ini.mkiv"></cd:source></pre> {{todo|more later --[[User:Taco|Taco]] ([[User talk:Taco|talk]]) 2215:5234, 9 10 August 2020 (CEST)}}

Navigation menu