Skip to content

Introduce templateutil for common template functionality#31

Merged
zimmski merged 1 commit intomasterfrom
templateutil
Feb 15, 2025
Merged

Introduce templateutil for common template functionality#31
zimmski merged 1 commit intomasterfrom
templateutil

Conversation

@zimmski
Copy link
Owner

@zimmski zimmski commented Feb 15, 2025

  • templateutil.DefaultFuncMap holds common template functions.
  • templateutil.MergeFuncMaps returns all functions of "a" and all functions of "b" in a new function mapping.
  • templateutil.WriteTemplateToFile executes a template with the given data and saves the result into a file.
  • templateutil.RewriteFileAsTemplate read in a file, execute it as a template with the given data and save the result into the same file.

- `templateutil.DefaultFuncMap` holds common template functions.
- `templateutil.MergeFuncMaps` returns all functions of "a" and all functions of "b" in a new function mapping.
- `templateutil.WriteTemplateToFile` executes a template with the given data and saves the result into a file.
- `templateutil.RewriteFileAsTemplate` read in a file, execute it as a template with the given data and save the result into the same file.
@zimmski zimmski self-assigned this Feb 15, 2025
@zimmski zimmski merged commit 9f35b45 into master Feb 15, 2025
1 check passed
@zimmski zimmski deleted the templateutil branch February 15, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant