yaml_tools.templates module

Template bits for generating SSG-style controls in YAML.

yaml_tools.templates.generate_control(context: Dict) Any[source]

Render an ID template string given a context dict.

yaml_tools.templates.xform_id(string: str, strip_trailing_zeros: bool = False) str[source]

Transform control ID strings, add leading zeros in forward direction:

AC-12(2) <==> ac-12.02

Caller should filter zero-length input or handle IndexError as needed.