There are two basic types of documentation:
The headings Usage, BaseFunction, Inputs, Outputs, and Consequences, are useful only for documentation of the first type, as well as in a call to SYNOPSIS.
Here is a basic template:
document { Key => {myFunc, (myFunc, MyType), [myFunc, MyOption], ...}, Headline => "one line description of myFunc", -- not needed for overviews BaseFunction => myFunc, -- usually not needed Usage => "myFunc x", Inputs => { inputs, ... }, Outputs => { outputs, ... }, SourceCode => { METHOD1, ... }, -- usually not needed Consequences => { side-effects, ... }, "A list of strings containings names of files in the auxiliary directory of the package can go here; the files will be visible in the current directory while example code is run.", ExampleFiles => {"datafile1", "datafile2"}, "There can be explanatory prose here in the form of a hypertext list.", EXAMPLE lines /// m2code m2code m2code ///, "There can be explanatory prose here in the form of a hypertext list.", Caveat => {"warning"}, SeeAlso => {"other things"}, Subnodes => { "subheading a", TO "node 1", TO "node 2", "subheading b", TO "node 3", ... }, } |
The object document is a function closure.