You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per #25, implement the Sprig functions for Bartholomew. Rather than file an issue for each function, I figured I'd break these down into small batches. (Note: I am not entirely sure all of the functions can be done with the same syntax. I am no pro in writing the Handlebars functions.)
wrap COUNT STRING Wrap text at a particular length (line ending: \n)
wrap_with COUNT ENDING STRING Wrap STRING using ENDING as the line ending. e.g. wrap_with "<br>" some_text will use <br> instead of a line break
contains SUBSTRING STRING returns boolean true if SUBSTRING is contained within STRING
has_prefix PREFIX STRING returns boolean true if PREFIX is found at the beginning of STRING
has_suffix SUFFIX STRING returns boolean true if SUFFIX is found at the end of STRING
cat STRING... Concatenates the given strings with spaces in between. cat "hello" "world" becomes hello world
indent COUNT STRING indent the string COUNT characters
nindent COUNT STRING add a new line and indent the string COUNT characters, (might not need this... it was originally really for YAML formatting)
replace TARGET REPLACEMENT STRING Replace all instances of TARGET with REPLACEMENT in the STRING
shuffle STRING randomly reorder the characters in STRING
The text was updated successfully, but these errors were encountered:
karthik2804
added a commit
to karthik2804/handlebars-sprig
that referenced
this issue
Aug 5, 2022
Per #25, implement the Sprig functions for Bartholomew. Rather than file an issue for each function, I figured I'd break these down into small batches. (Note: I am not entirely sure all of the functions can be done with the same syntax. I am no pro in writing the Handlebars functions.)
wrap COUNT STRING
Wrap text at a particular length (line ending:\n
)wrap_with COUNT ENDING STRING
Wrap STRING using ENDING as the line ending. e.g.wrap_with "<br>" some_text
will use<br>
instead of a line breakcontains SUBSTRING STRING
returns boolean true if SUBSTRING is contained within STRINGhas_prefix PREFIX STRING
returns boolean true if PREFIX is found at the beginning of STRINGhas_suffix SUFFIX STRING
returns boolean true if SUFFIX is found at the end of STRINGcat STRING...
Concatenates the given strings with spaces in between.cat "hello" "world"
becomeshello world
indent COUNT STRING
indent the string COUNT charactersnindent COUNT STRING
add a new line and indent the string COUNT characters, (might not need this... it was originally really for YAML formatting)replace TARGET REPLACEMENT STRING
Replace all instances of TARGET with REPLACEMENT in the STRINGshuffle STRING
randomly reorder the characters in STRINGThe text was updated successfully, but these errors were encountered: