frontman
frontman copied to clipboard
Create a Markdown extension
Description
A simplified markup language that lets you leverage Ruby functions and partials with a more Markdown-like syntax.
Motivation
We currently provide a way for users to mix different rendering languages. This is nice and should stay, but it would be even better to have a unified language that lets you leverage ERB with a Markdown-like syntax. This is more user friendly for writers, and allows you to lint content with tools like stylelint without having to write a custom parser.
Solution
We could extend Markdown to develop a few tags that let users leverage Ruby features without actually writing ERB.
For example:
# Before
<%= partial 'panel/table.haml', locals: {
data: {
'Group title': [
{
text: 'My title',
link: '/path/to/page/'
}
],
}
} %>
// After
<panel-table groups="[{ text: 'My title', link: '/path/to/page/' }]" />