gdDocumentation0.8.0

API reference

GDHTMLTemplate

Immutable template parsed by GD.html.template. execute renders text, execute_bytes renders UTF-8 bytes, and the value can be shared across requests.

Methods

execute

execute(data: Dictionary) -> String, Err

Return HTML with safely interpolated values.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

execute_bytes

execute_bytes(data: Dictionary) -> PackedByteArray, Err

Return escaped HTML directly as UTF-8 bytes.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.