docs/current_docs/extending/modules/documentation.mdx
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, dagger call ... --help, or .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:
The following code snippet shows how to add documentation for:
The documentation of the module is added in the package-info.java file.
/**
* A simple example module to say hello.
*
* Further documentation for the module here.
*/
@Module
package io.dagger.modules.mymodule;
import io.dagger.module.annotation.Module;
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" queryString="sdk"> <TabItem value="go" label="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]