tera-sprig

Crates.iotera-sprig
lib.rstera-sprig
version0.1.0
sourcesrc
created_at2024-08-08 07:22:59.101764
updated_at2024-08-08 07:22:59.101764
descriptionSprig Functions for Tera Template Engine
homepagehttps://gitee.com/jia2024/tera-sprig.git
repositoryhttps://gitee.com/jia2024/tera-sprig.git
max_upload_size
id1329211
size38,811
(lovejia2022)

documentation

README

Sprig Functions for Tera Template Engine

Sprig is a list of tempalte functions for Go tempaltes.

This project transplant Sprig to Tera template language.

Strings

Built-ins

  • trim - builtin
  • trimAll(substr)
  • trimSuffix(suffix)
  • trimPrefix(prefix)
  • upper
  • lower
  • title
  • untitle
  • repeat(count)
  • substr(start, len)
  • nospace
  • trunc(len)
  • abbrev(len)
  • abbrevboth(left, maxlen)
  • initials
  • randAlphaNum(len)
  • randAlpha(len)
  • randNumeric(len)
  • 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)
  • snakecase
  • camelcase
  • 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
Commit count: 0

cargo fmt