docs/versioned_docs/version-0.16.3/api/documentation.mdx
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
Dagger modules and Dagger Functions should be documented so that descriptions are shown in the API and the CLI - for example, when calling dagger functions and dagger call ... --help.
The following code snippet shows how to add documentation for:
The following code snippet shows how to use Python's documentation string conventions for adding descriptions to:
For function arguments, annotate with the dagger.Doc metadata.
:::note
dagger.Doc is just an alias for typing_extensions.Doc.
:::
The following code snippet shows how to add documentation for:
The following code snippet shows how to add documentation for:
Here is an example of the result from dagger functions:
Name Description
hello Return a greeting.
loud-hello Return a loud greeting.
Here is an example of the result from dagger call hello --help:
Return a greeting.
USAGE
dagger call hello [arguments]
ARGUMENTS
--greeting string The greeting to display [required]
--name string Who to greet [required]
The following code snippet shows how to add documentation for an object and its fields in your Dagger module:
<Tabs groupId="language"> <TabItem value="Go">Here is an example of the result from dagger call --help:
ARGUMENTS
--age int The age of the user. [required]
--name string The name of the user. [required]