Macaulay2 » Documentation
Packages » SimpleDoc » doc
next | previous | forward | backward | up | index | toc

doc -- a simple documentation function

Description

The string s contains a series of sections describing the documentation to be produced. The first line of each section contains only a keyword that specifies the purpose of that section. The keywords must all be indented to the same level, and everything else must be further indented. Lines beginning with white space followed by two hyphens are ignored and can be used for commenting.

For backwards compatibility, the function multidoc is also a synonym for doc.

Template for documentation strings

The variable docTemplate is a String, which can be cut and pasted into a text file, to be used as a template for writing documentation for functions and other objects in a package.

doc ///
Node
  Key
  Headline
  Usage
  Inputs
  Outputs
  Consequences
    Item
  Description
    Text
    Tree
    Code
    Pre
    Example
    CannedExample
  ExampleFiles
  Acknowledgement
  Contributors
  References
  Caveat
  SeeAlso
  Subnodes
///

Description of keywords allowed in documentation strings

The only keyword which is always required is Key. Other valid keywords are:

Markup keywords allowed in documentation strings

The documentation system allows using $\LaTeX$ commands, so mathematical expressions may be displayed as $\PP^3$ or $x_i^{33} + 1/2$ in the html form of the documentation. For details and examples see html(TEX).

Also allowed is a pair of @ characters, enclosing Macaulay2 code to be executed, yielding appropriate hypertext. For example "The @TO Key@ section is required" will appear as "The Key section is required." This package also provides a number of helper functions, such as the arXiv function, which may be used to succinctly reference e-Prints. See Text for other hypertext types.

Note that any Macaulay2 code resulting in a String or Hypertext may be used inside @...@, but for longer code it is easier to use the Code keyword described above.

Documenting multiple nodes at once

If the least indented keyword in the documentation string s is Node, possibly occurring multiple times, multiple documentation nodes will be prepared.

  • Node

    The text following each such keyword is handled just as by doc resulting in a separate documentation node.

See SimpleDoc/doc.txt for an example of how the Node keyword is used in documenting this package.

See also

Ways to use doc:

  • doc(String)

For the programmer

The object doc is a method function.


The source of this document is in SimpleDoc.m2:308:0.