Skip to content

Text formatting

When writing for the web, nobody really wants to wrap HTML tags around text. On the other hand, most WYSIWYG editors produce awful HTML output and have tons of other issues. In Kirby, content is therefore marked up and formatted in Markdown or our extended version of it, which we call KirbyText.

Markdown

The following Markdown tags are available to add simple formatting to your text.

Markdown Extra

If you need even more options to format text, like footnotes, tables, definition lists, etc. you can activate Markdown Extra in your config file to use those additional formats:

/site/config/config.php
return [
  'markdown' => [
    'extra' => true
  ]
];

KirbyText

In addition to Markdown, Kirby automatically parses a set of handy tags in your text, whenever you use the ->kirbytext() field method to render content in your templates. Those tags make it simple to embed links, images, videos and more.

Using KirbyTags in templates

You can even use KirbyTags in your templates with the kirbytag() helper, for example to embed a video quickly:

<?= kirbytag([
  'video'  => 'http://vimeo.com/3432886',
  'width'  => 400,
  'height' => 400
]);

Extending KirbyText

You'd love to have a special tag for embedding cat pictures from http://placekitten.com/ or you need some other tags for your next client project?

KirbyText is extensible, so you can actually build in all the great features you need.

SmartyPants

SmartyPants is a handy little helper to convert typical formatting issues in text into a typographically correct version. This includes quotes, dashes and more.

When you activate SmartyPants in your config, SmartyPants rules are automatically applied whenever you use the ->kirbytext() or ->smartypants() field methods.

/site/config/config.php
return [
  'smartypants' => true
];