DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

Markdown-friendly template engines, with full power of HTML?

I think it is highly missing, but one of them is Pug. And probably other indentation-based template engines, e.g. HAML.

With proper settings, you can do things like

# Hello World

![Workload of this image is lightened by Markdown renderer](https://img.url/name.png)

!!!pug
center
  web-component-one
    markdown:
      [Again, This link is safen by the Markdown renderer by adding rel's.](http://potentially.dangero.us)

      ## Header of content

      !!!pug
      div(style="color: red; text-align: right;")
        web-component-two
          markdown:
            ![alt text](image embedded inside web component)
      !!!
!!!
Enter fullscreen mode Exit fullscreen mode

Sadly, Pug when run directly on the browser is quite large, and you might have to resort to couple of AJAX requests instead, so I created a leaner package.

GitHub logo patarapolw / hyperpug

Lightweight Pug for browser/Electron. With Pug filters' support, which can also contain indented language like markdown.

Seriously, Markdown compatible template engines are missing, or should I rather ask for non-indentation-based alternatives to Markdown?

Top comments (0)