Difference between revisions of "HowTo:Document an ApCoCoA-2 Package"

From ApCoCoAWiki
m (grammar)
(→‎Creating Package Main Page: extended math mode warning)
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
== Main Structure ==
 
== Main Structure ==
 
Currently, the ApCoCoA help is exported from time to time from this wiki. For this to work properly, please carefully proceed with the following steps:
 
Currently, the ApCoCoA help is exported from time to time from this wiki. For this to work properly, please carefully proceed with the following steps:
# Create the page '''Category:Package <span style="color:red;"><<package name>></span>''' and add the code <code><nowiki>[[</nowiki>Category:ApCoCoA Packages<nowiki>]]</nowiki></code> so that the page is added to [[:Category:ApCoCoA Packages]]
+
# Create the page '''Category:Package <span style="color:red;"><<package name>></span>''' (e.g. [[:Category:Package sagbi]]) and add the code <code><nowiki>[[</nowiki>Category:ApCoCoA Packages<nowiki>]]</nowiki></code> so that the page is added to [[:Category:ApCoCoA Packages]]
# Create the page '''Package <span style="color:red;"><<package name>></span>'''.
+
# Create the page '''Package <span style="color:red;"><<package name>></span>''' (e.g. [[:Package sagbi]], details [[#Creating Package Main Page|below]]).
# For every function in the package you want to describe, create a page '''Package <span style="color:red;"><<package name>></span>/<span style="color:red;"><<alias>></span>.<span style="color:red;"><<function name>></span>''', e.g. [[Package sagbi/SB.IsInSubalgebra]]
+
# For every function in the package you want to describe, create a page '''Package <span style="color:red;"><<package name>></span>/<span style="color:red;"><<alias>></span>.<span style="color:red;"><<function name>></span>''' (e.g. [[Package sagbi/SB.IsInSubalgebra]], details [[#Creating Function Descriptions|below]]).
 
# (optional) If there was already a similar package in ApCoCoA-1, then you can add links to the old package from the new one and vice versa. For details, see [[Template:Version]].
 
# (optional) If there was already a similar package in ApCoCoA-1, then you can add links to the old package from the new one and vice versa. For details, see [[Template:Version]].
  
Line 23: Line 23:
 
For a detailed description of the math extention, see [https://en.wikipedia.org/wiki/Help:Displaying_a_formula Help:Displaying a formula] from Wikipedia.
 
For a detailed description of the math extention, see [https://en.wikipedia.org/wiki/Help:Displaying_a_formula Help:Displaying a formula] from Wikipedia.
  
Note: Each math environment is rendered as an image, which may take the server a view seconds to compile. Therefore it is recommended to backup data (e.g. copying it into the clipboard) before saving the page or viewing the preview.
+
'''Warning''': Each math environment is rendered as an image, which may take the server a view seconds to compile. Therefore it is recommended to backup data (e.g. copying it into the clipboard) before saving the page or viewing the preview. To avoid performance issues, one can also use bold italics instead of math texts, e.g. write '''''K''''' instead of <math>K</math> for fields, if the context is clear.
  
 
== Creating Function Descriptions ==
 
== Creating Function Descriptions ==
For this step to work correctly, it is necessary to use the following XML template (see also [[Documentation Principles]] for ApCoCoA-1) since the ApCoCoA-2 help is exported from the Wiki. Please do not use any Wiki syntax or LaTeX code on the function page as they will not be rendered when exported. If you need to describe anything mathematically, then please use the Package main page instead, otherwise please use the Format options below.
+
For this step to work correctly, it is necessary to use the following XML template (see also [[Documentation Principles]] for ApCoCoA-1) since the ApCoCoA-2 help is exported from the Wiki. Please do not use any Wiki syntax or LaTeX code on the function page as they will not be rendered when exported. If you need to describe anything mathematically, then please use the Package main page instead, otherwise please use the Format options below. Note: <code><span style="color:red;"><<package name>></span></code> is the name of the package in small letters, e.g. <code>sagbi</code> in <code>Package sagbi</code>. The placeholder <code><span style="color:red;"><<alias>></span></code> is the global alias, usually in capital letters.
 
<!--------------------------------------------------------------------------------------------------------------------------->
 
<!--------------------------------------------------------------------------------------------------------------------------->
 
<div class="mw-collapsible mw-collapsed">
 
<div class="mw-collapsible mw-collapsed">
Line 38: Line 38:
 
   <syntax></nowiki><span style="color:red;"><<alias>></span>.<span style="color:red;"><<function name>></span>(<span style="color:red;"><<input parameters and types>></span>):<span style="color:red;"><<output type>></span><nowiki></syntax>
 
   <syntax></nowiki><span style="color:red;"><<alias>></span>.<span style="color:red;"><<function name>></span>(<span style="color:red;"><<input parameters and types>></span>):<span style="color:red;"><<output type>></span><nowiki></syntax>
 
   <description>
 
   <description>
    </nowiki><span style="color:red;"><nowiki><!-- Here comes a short description of the functions --></nowiki></span><nowiki>
+
</nowiki><span style="color:red;"><nowiki><!-- (no indent) Here comes a short description of the functions --></nowiki></span><nowiki>
 
     <itemize>
 
     <itemize>
 
       </nowiki><span style="color:red;"><nowiki><!-- Describe every input parameter of the function --></nowiki></span><nowiki>
 
       </nowiki><span style="color:red;"><nowiki><!-- Describe every input parameter of the function --></nowiki></span><nowiki>

Latest revision as of 17:43, 13 February 2021

This page describes how to document an ApCoCoA-2 package in the Wiki. For an overview on how to contribute a package and an example, see HowTo:Contribute an ApCoCoA-2 Package. In order to do this, you need to have a wiki account. Such an account can only be created by a wiki admin, so please contact the ApCoCoA team so we can create an account for you.

Note: In the following description, words marked as <<word>> are placeholders, i.e. you should replace this text after copying.

Main Structure

Currently, the ApCoCoA help is exported from time to time from this wiki. For this to work properly, please carefully proceed with the following steps:

  1. Create the page Category:Package <<package name>> (e.g. Category:Package sagbi) and add the code [[Category:ApCoCoA Packages]] so that the page is added to Category:ApCoCoA Packages
  2. Create the page Package <<package name>> (e.g. Package sagbi, details below).
  3. For every function in the package you want to describe, create a page Package <<package name>>/<<alias>>.<<function name>> (e.g. Package sagbi/SB.IsInSubalgebra, details below).
  4. (optional) If there was already a similar package in ApCoCoA-1, then you can add links to the old package from the new one and vice versa. For details, see Template:Version.

Creating Package Main Page

The main page of the package is the page Package <<package name>>. For an example, see Package sagbi.

First, please add [[Category:Package <<package name>>]] and [[Category:ApCoCoA Packages]]</nowiki> so that the page is added to the correct categories.

Now you can describe your package using any syntax this Wiki provides. For a description of the MediaWiki syntax, see Help:Wikitext from Wikipedia. While some things may be formated differently in the ApCoCoA Wiki, the syntax here is the same as in Wikipedia. Additionally, you can use LaTeX to write mathematical equations. For instance, the code <math>x_1^2</math> generates , the code

:<math>\sum_{i=1}^\infty \left(\frac{1}{2}\right)^n.</math>

generates

.

For a detailed description of the math extention, see Help:Displaying a formula from Wikipedia.

Warning: Each math environment is rendered as an image, which may take the server a view seconds to compile. Therefore it is recommended to backup data (e.g. copying it into the clipboard) before saving the page or viewing the preview. To avoid performance issues, one can also use bold italics instead of math texts, e.g. write K instead of for fields, if the context is clear.

Creating Function Descriptions

For this step to work correctly, it is necessary to use the following XML template (see also Documentation Principles for ApCoCoA-1) since the ApCoCoA-2 help is exported from the Wiki. Please do not use any Wiki syntax or LaTeX code on the function page as they will not be rendered when exported. If you need to describe anything mathematically, then please use the Package main page instead, otherwise please use the Format options below. Note: <<package name>> is the name of the package in small letters, e.g. sagbi in Package sagbi. The placeholder <<alias>> is the global alias, usually in capital letters.

Wikipage template
{{Version|2}}
<command>
  <title><<alias>>.<<function name>></title>
  <short_description>Function description in one sentence</short_description>
  
  <syntax><<alias>>.<<function name>>(<<input parameters and types>>):<<output type>></syntax>
  <description>
<!-- (no indent) Here comes a short description of the functions -->
    <itemize>
      <!-- Describe every input parameter of the function -->
      <item>@param <tt><<parameter name>></tt> <<parameter description>></item>
      <item>@param <tt><<parameter name>></tt> <<parameter description>></item>
      <item>@return <<description of the return value>></item>
    </itemize>
 
    <!-- Examples here (also only one or more than two possible) -->
    <!-- It is important to omit any indentation inside the example environment -->
    <!-- may also go over more lines, but the </example>-tag should not be in a new line -->
    <example><<first example>></example>
    <example><<second example>></example>
  </description>

  <!-- Add related pages (also more or none possible) -->
  <seealso>
    <see><<first page>></see>
    <see><<second page>></see>
  </seealso>

  <!-- Add all data types used in the signature of your function (also more or none possible) -->
  <types>
    <type><<first type>></type>
    <type><<second type>></type>
  </types>

  <!-- Add keys here (first three are mandatory, other ones are optional) -->
  <key><<function name>></key>
  <key><<alias>>.<<function name>></key>
  <key><<package name>>.<<function name>></key>
  <key><<first key>></key>
  <key><<second key>></key>

  <wiki-category>Package <<package name>></wiki-category>

</command>

After creating the page, you can remove the comments, i.e. the lines starting with <!-- and ending with -->. Alternatively, you can use the following template comments removed:

Empty Wikipage template
{{Version|2}}
<command>
  <title></title>
  <short_description></short_description>

  <syntax></syntax>
  <description>
    <itemize>
      <item>@param <tt></tt>  </item>
      <item>@param <tt></tt>  </item>
      <item>@return  </item>
    </itemize>

    <example></example>
  </description>

  <seealso>
    <see></see>
    <see></see>
  </seealso>

  <types>
    <type></type>
    <type></type>
  </types>

  <key></key>
  <key></key>
  <key></key>

  <wiki-category>Package </wiki-category>
</command>

Instead of Wiki syntax, you can use the following tags to format the function pages:

  • For itemizations, use
<itemize>
  <item>first item</item>
  <item>second item</item>
  ...
</itemize>
  • For italics, use
<em>...</em>
  • For code in the body text like variables, write
<tt>...</tt>
  • For new paragraps (Wiki paragraphs are not exported to the ApCoCoA manual), write:
<par/>