Dagger
Search

templating

This module provides template rendering capabilities using Go's text/template package.
It supports loading templates from local files or HTTPS URLs, and accepts variables
from YAML files or command-line parameters.

Templates can use any file extension, with optional .tmpl suffix that will be
automatically removed in the output. Variables can be provided via a YAML file,
command-line key=value pairs, or both (command-line takes precedence).

The module can be called from the dagger CLI or from any of the Dagger SDKs.

Installation

dagger install github.com/stuttgart-things/dagger/templating@v0.45.0

Entrypoint

Return Type
Templating
Example
dagger -m github.com/stuttgart-things/dagger/templating@28a31245c01b71aa85a3e62c3f09c9b14c9ba5be call \
func (m *MyModule) Example() *dagger.Templating  {
	return dag.
			Templating()
}
@function
def example() -> dagger.Templating:
	return (
		dag.templating()
	)
@func()
example(): Templating {
	return dag
		.templating()
}

Types

Templating 🔗

render() 🔗

RenderTemplates renders Go templates with provided variables templates: comma-separated list of template paths (local in src or HTTPS URLs) variables: comma-separated list of key=value pairs (e.g., “name=John,age=30”) variablesFile: optional YAML file with variables (variables parameter has higher priority)

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
templatesString !-No description provided
variablesString -No description provided
variablesFileString -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/templating@28a31245c01b71aa85a3e62c3f09c9b14c9ba5be call \
 render --src DIR_PATH --templates string
func (m *MyModule) Example(src *dagger.Directory, templates string) *dagger.Directory  {
	return dag.
			Templating().
			Render(src, templates)
}
@function
def example(src: dagger.Directory, templates: str) -> dagger.Directory:
	return (
		dag.templating()
		.render(src, templates)
	)
@func()
example(src: Directory, templates: string): Directory {
	return dag
		.templating()
		.render(src, templates)
}