Table of contents

HotDocs: Markdown

{}{}DANGER
HotDocs evaluates Ruby code on your server when rendering. Only use it for trusted markdown content.
{}INFO
Markdown support is currently under development. You can chime in on this GitHub discussion to share wishes and feedback.

HotDocs supports templates ending in .mderb: you can mix markdown and erb in the same template.

Behind the curtains, .mderb templates are compiled first as .erb and second as .md with kramdown & kramdown-parser-gfm.

HTML in Markdown

You can use HTML in .mderb templates.

If you want to use markdown inside HTML, add the markdown="1" attribute (see the Kramdown syntax docs):

<div markdown="1">
This is `markdown`:

```ruby
puts "hello, world!"
```
</div>

Syntax highlight

HotDocs highlights code blocks with rouge.

You can customize the css styles by editing rouge.css or by replacing it with any Pygments-compatible theme (just wrap it in .article {}).

Alerts

On top of the markdown syntax, HotDocs supports alerts as follows (icons from Heroicons):

<%= alert :info do %>
  This is an info.
<% end %>

<%= alert :tip do %>
  This is a tip.
<% end %>

<%= alert :warning do %>
  This is a warning.
<% end %>

<%= alert :danger do %>
  This is a danger.
<% end %>
{}INFO
This is an info.
{}TIP
This is a tip.
{}WARNING
This is a warning.
{}{}DANGER
This is a danger.

Built with Rails & HotDocs