-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from chezmoi/docs
chore: Add more docs
- Loading branch information
Showing
3 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# templatefuncs | ||
|
||
Package templatefuncs provides a rich set of | ||
[text/template](https://pkg.go.dev/text/template) functions. | ||
|
||
templatefuncs is a modern alternative to | ||
[github.com/masterminds/sprig](https://github.com/masterminds/sprig) with the | ||
following goals: | ||
|
||
* Flexible, practical typing of user-equivalent types (e.g. functions that | ||
accept `string`s also accept `fmt.Stringer`s and `[]byte`s). | ||
* Correct argument order, compatible with text/template's pipelines where the | ||
most variable argument is passed last (e.g. so you can write `dict "key" | ||
"value" | hasKey "key"` instead of `hasKey (dict "key" value") "key"`). | ||
* Idiomatic Go naming conventions (e.g. `toJSON`, not `toJson`). | ||
* Structure-preserving transformations (e.g. `toLower` converts a `string` to a | ||
`string` and also converts a `[]string` to a `[]string`). | ||
* Linkable documentation for individual template functions (so you can direct | ||
users to the documentation for a single function, not just a page of | ||
functions). | ||
* Exported documentation which you can include in your own project (so you can | ||
include a full list of template functions that your project supports). | ||
* Actively maintained. | ||
|
||
templatefuncs explicitly is *not* backwards compatible with | ||
github.com/masterminds/sprig. | ||
|
||
templatefuncs is currently in the experimental stage and is not suitable for | ||
production use. | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters