Formatting Text

Kirbytext

Kirby has a built-in converter for the fantastic Markdown syntax by John Gruber. Markdown is a way to add formats in plain text with easy learnable and understandable tags. To offer more site-specific features Kirby has its own version of Markdown called Kirbytext.

To learn more about how to format text with Kirbytext please follow the
Kirby Text Formatting Tutorial


kirbytext($text)

To use the Kirbytext converter in your templates, you can call it like this:

 

More ways to work with text

html($text) or h($text)

Converts the given text to valid HTML. This is very handy to make sure your content will be displayed correctly.

 

xml($text)

Converts the given text to valid xml. This is very handy for feeds.

 

multiline($text)

Converts new lines to breaks and also converts the text to HTML.

 

markdown($text)

Convert markdown from your content files to valid HTML. This makes it super easy to add nice rich content to your pages, without knowing HTML.

 

excerpt($text, $length=140)

Extracts a short excerpt of a text and makes sure that words are not messed-up and html tags are stripped properly. You can define the number of maximum characters with the second parameter.