# tera-sprig **Repository Path**: jia2024/tera-sprig ## Basic Information - **Project Name**: tera-sprig - **Description**: Sprig Functions for Tera Template Engine - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: https://gitee.com/jia2024/tera-sprig - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-08-08 - **Last Updated**: 2024-08-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Sprig Functions for Tera Template Engine [Sprig][Sprig] is a list of tempalte functions for Go tempaltes. This project transplant [Sprig] to [Tera] template language. [Sprig]: http://masterminds.github.io/sprig [Tera]: https://keats.github.io/tera ## Command line tools or library If feature `cli` is on, an executable `teras` is built to render [Tera] template with [Sprig] functions from file. ## TODO ### Strings #### Built-ins - [x] trim - [x] trim_suffix(suffix=STRING) - [x] trim_prefix(prefix=STRING) - [x] upper - [x] lower - [x] title - [x] untitle - [x] repeat(count=U64) - [x] substr(start=U64, end=U64) - [x] nospace - [x] trunc(len=U64) - [x] abbrev(len=U64) - [ ] abbrevboth(left, maxlen) - [ ] initials - [x] rand_alpha_num(len=U64) - [x] rand_alpha(len=U64) - [x] rand_numeric(len=U64) - [ ] randAscii(len) - [ ] wrap(len) - [ ] wrapWith(len, sep) - [ ] contains(substr) - [ ] hasPrefix(prefix) - [ ] hasSuffix(suffix) - [ ] quote - [ ] squote - [ ] cat - [ ] indent(len) - [ ] nindent(len) - [ ] replace(from, to) - [ ] plural(one, more) - [x] snakecase - [x] camelcase - [x] kebabcase - [ ] swapcase - [ ] shuffle - [ ] regexMatch - [ ] mustRegexMatch - [ ] regexFindAll - [ ] mustRegexFindAll - [ ] regexFind - [ ] mustRegexFind - [ ] regexReplaceAll - [ ] mustRegexReplaceAll - [ ] regexReplaceAllLiteral - [ ] mustRegexReplaceAllLiteral - [ ] regexSplit - [ ] mustRegexSplit - [ ] regexQuoteMeta ### String Slice Functions - [ ] join - [ ] splitList - [ ] split - [ ] splitn - [ ] sortAlpha ### Integer Math Functions - [ ] add - [ ] add1 - [ ] sub - [ ] div - [ ] mod - [ ] mul - [ ] max - [ ] min - [ ] floor - [ ] ceil - [ ] round - [ ] randint ### Advanced Functions #### Reflection Functions - [x] sprig_kind_of - [x] sprig_kind - No `deepEqual` and `typeIsLike`, because tera do not have pointer data.