Module

rendering.template_functions.debug

Debug utility functions for templates.

Provides 3 functions for debugging templates during development.

Functions

register
Register debug utility functions with Jinja2 environment.
2 None
def register(env: Environment, site: Site) -> None

Register debug utility functions with Jinja2 environment.

Parameters 2

Name Type Default Description
env Environment
site Site
debug
Pretty-print variable for debugging.
2 str
def debug(var: Any, pretty: bool = True) -> str

Pretty-print variable for debugging.

Parameters 2

Name Type Default Description
var Any

Variable to debug

pretty bool True

Use pretty printing (default: True)

Returns

str

String representation of variable

typeof
Get the type of a variable.
1 str
def typeof(var: Any) -> str

Get the type of a variable.

Parameters 1

Name Type Default Description
var Any

Variable to check

Returns

str

Type name as string

inspect
Inspect object attributes and methods.
1 str
def inspect(obj: Any) -> str

Inspect object attributes and methods.

Parameters 1

Name Type Default Description
obj Any

Object to inspect

Returns

str

List of attributes and methods