Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > writing documentation > SYNOPSIS
next | previous | forward | backward | up | index | toc

SYNOPSIS -- a standardized synopsis for use in documentation nodes

Synopsis

Description

This function prepares a standardized synopsis in hypertext for use in documentation nodes. Here is an empty template for use with SYNOPSIS.


SYNOPSIS (
        BaseFunction => fn,
        Heading      => "",
        Usage        => "",
        Inputs       => {},
        Outputs      => {},
        Consequences => {},
        PARA { ... },
        EXAMPLE lines " ... ")

The options are used just as with document. Here is an example of its use.


SYNOPSIS {
        Heading => "using binary methods for method functions",
        Usage   => "f(x,y)",
        Inputs  => {
            "f" => { "a method function" },
            "x" => { "an object of type ", TT "X" },
            "y" => { "an object of type ", TT "Y" }},
        Outputs => {
            { "the previously installed method for ", TT "f(X, Y)", " is called with arguments ", TT "(x, y)",
                ", and the return value is returned. If no such method has been installed, then Macaulay2
                searches for a method for ", TT "f(X',Y')", ", where ", TT "X'", " is an ancestor of ", TT "X",
                " and ", TT "Y'", " is an ancestor of ", TT "Y", "(see ", TO "inheritance", " for details)."}},
        "The second line of the following example illustrates the syntax above,
        using ", TO "source", ", which happens to be a method function.",
        EXAMPLE lines ///
          source(String, String) := peek;
          source("foo", "bar")///,
        PARA "The same syntax works for 3 or 4 arguments."}

See the Synopsis keyword in doc(String) for usage as a keyword in that format.

Ways to use SYNOPSIS :

For the programmer

The object SYNOPSIS is a method function with a single argument.