Configuring your Markdown engine

To store and edit Markdown content in CloudCannon, we need to process it into HTML to make it editable. You can use any Markdown engine you want when building your site, this only covers the Markdown content you edit inside CloudCannon.

CloudCannon supports the CommonMark and Kramdown specifications. The implementations for these are markdown-it (JavaScript) andkramdown (Ruby). Both of these support various options that are configurable, with good default options covering most use cases. You can adjust these if you need to precisely match what your SSG uses to process Markdown for your builds.

CommonMark

CommonMark is a popular Markdown specification that aims to become standard and unambiguous.

To use CommonMark for your build and editors:

  1. Add the jekyll-commonmark gem to your Gemfile
  2. Set the markdown field to CommonMark in _config.yml
  3. Set your options in the commonmark field in _config.yml
Gemfile
source 'https://rubygems.org'

gem 'jekyll', '3.8.5'

group :jekyll_plugins do
  gem 'jekyll-commonmark', '1.3.1'
end
_config.yml
markdown: CommonMark

commonmark:
  options: ["SMART", "UNSAFE"]
  extensions: ["strikethrough", "table"]
Note

The UNSAFE option is required for HTML content inside your Markdown files to render correctly.

CommonMark does not support a syntax to define attributes on elements. In order to preserve attributes, that content saves as HTML within your Markdown files.

Kramdown

Kramdown is another specification, and the default Markdown processor for Jekyll.

Jekyll comes standard with Kramdown installed and configured. CloudCannon reads your kramdown settings in _config.yml to match editing and builds.

To use Kramdown:

  1. Remove or set the markdown field to kramdown in _config.yml
  2. Set your options in the kramdown field in _config.yml (optional)
_config.yml
kramdown:
  input: GFM
  auto_ids: true
Was this article helpful? or Suggest an improvement >