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

# Key -- key of a documentation node

- Usage:
    `document { Key => key, ... }`
- Consequences:
  - specifies the name under which the documentation is stored

## Description

The document key is the name of the node, specifically the one that allows users to find the documentation for the desired command. Some node names, rather than being strings, are sequences of Macaulay2 objects that refer to specific method functions. If one is documenting a function of Macaulay2, the key will just be the function's name, as in the documentation for resolution.

    Key => {resolution}

However, if one is documenting a method for a function, then the key will have a different form, as in the documentation for resolution(Module).

    Key => {(resolution, Module)}

If one is documenting an optional argument to a function, then the key has a different form still, as in resolution(...,SyzygyLimit=>...).

    Key => {[resolution, SyzygyLimit]}

Finally, if one is documenting an overview of a group of functions or a package, as in ideals then one would set up a document key of the form:

    Key => {"ideals"}

## Caveat

No two documentation nodes may have the same key or even a key that is a synonym for a key which is already used. However, sometimes there is a need for several documentation nodes to have the same key. This happens when a command that needs to be documented is a synonym for another already documented command. In this case the synonym's key should be stated in quotation marks. As an example, look at the documentation for SUBSECTION and HEADER2 in Text.m2.

## See also

- TO -- hypertext documentation link

## Functions with optional argument named Key:

- `document(...,Key=>...)`

## For the programmer

The object Key is a symbol.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/document-doc.m2:461:0.