Built-in Plugins
These plugins are built into microfern. You do have to import and pass them into
format
explicitly, but they are included in the standard install.
Check this example to see how to do that.
List of Plugins
uppercase
This plugin converts all characters in the input text to uppercase.
Chef's secret: {{ fruit | uppercase }} is the key to a good smoothie!
{ "fruit": "banana" }
lowercase
This plugin converts all characters in the input text to lowercase.
Whisper it: i love {{ veggie | lowercase }} in my salad!
{ "veggie": "BROCCOLI" }
capitalize
This plugin capitalizes the first character of the input text.
Once upon a thyme, there was an {{ herb | capitalize }}...
{ "herb": "italian parsley" }
titleCase
This plugin converts the input text to title case, capitalizing the first letter of each word.
Breaking News: {{ headline | titleCase }}
{ "headline": "local man finds tomato that looks like elvis" }
snakeCase
This plugin replaces spaces in the input text with underscores.
Secret code: {{ message | snakeCase }}
{ "message": "the carrots are listening" }
kebabCase
This plugin replaces spaces in the input text with hyphens.
<a href="/meals/{{ dish | kebabCase }}">Today's special</a>
{ "dish": "Eggplant Extravaganza" }
camelCase
This plugin converts the input text to camel case, removing spaces and capitalizing the first letter of each word except the first.
Variable name: {{ fruitSalad | camelCase }}IsYummy
{ "fruitSalad": "tropical fruit bonanza" }
pascalCase
This plugin converts the input text to pascal case, removing spaces and capitalizing the first letter of each word.
Class name: {{ veggieDish | pascalCase }}Recipe
{ "veggieDish": "turnip the beet salad" }
trim
This plugin removes whitespace from both ends of the input text.
Remember to trim the {{ ingredient | trim }} before cooking!
{ "ingredient": " string beans " }
trimStart
This plugin removes whitespace from the beginning of the input text.
[{{ shape | trimStart }}] shaped rhubarb
{ "shape": " fish " }
trimEnd
This plugin removes whitespace from the end of the input text.
[{{ shape | trimEnd }}] shaped rhubarb
{ "shape": " rhubarb " }
urlEscape
This plugin URL-encodes the input text.
<a href="/search/?q={{ search | urlEscape }}> Search </a>
{ "search": "how to tuna fish" }
urlUnescape
This plugin URL-decodes the input text.
You searched: {{ query | urlUnescape }}
{ "query": "Are%20tomatoes%20secretly%20fruit%20spies%3F" }
reverse
This plugin reverses the characters in the input text.
"I say, {{ phrase }}! That didn't work? Then {{ phrase | reverse }}!"
{ "phrase": "open sesame" }
escapeHtml
This plugin escapes special HTML characters in the input text.
shop for {{ html | escapeHtml }}
{ "html": "my favorite apple variety is the <script>bobby tables apple</script>" }
unescapeHtml
This plugin unescapes special HTML characters in the input text.
Joke of the day: {{ html | unescapeHtml }}
{ "html": "Can I get some peas & quiet?!" }
stripHtml
This plugin removes all HTML tags from the input text.
Foiled again, {{ html | stripHtml }}!
{ "html": "<script>baked potato</script>" }
truncate
This plugin truncates the input text to the specified length. It's a higher-order plugin that takes a length parameter, which is required.
The Amazing {{ veggie | truncate 21 }}
{ "veggie": "Purple Sprouting Broccoli" }