1. 6

  2. 2

    Yes! I have wanted something like this for a while. It would be perfect for blogs, or any situation where you need to make a page but then sometimes add some custom HTML too. Embedding Markdown inside of Haml just seems like the wrong direction; the strategy outlined here makes much more sense.

    1. 1

      I’ve been doing this for years using nanoc with kramdown support, which I’m quite happy with, so I’m not 100% sure how much of this idea overlaps with it.

      Fulrthermore, kramdown also allows you to render your content for different output formats beyond HTML, which I use for creating both a PDF and a web page for certain content.

      1. 1

        I never used Haml, but I use Slim (which looks similar) and have lots of frustration with it.

        • I just constantly don’t know what will be end result (html). Either I don’t remember exact syntax features (such as inline tags, variants of verbatim and how it should be indented, where ruby code is evaluated in attributes and where not), or these features interact in ambiguous ways (1, 2, 3) (these are mostly bugs but root cause is syntax requiring handling tons of corner cases)
        • Indentation-based syntax works for Python and Haskell where usually you don’t have 20 levels of nesting and long blocks. In HTML you have insane nesting and long blocks all the time, and constantly need to re-nest blocks.

        Adding Markdown to this feels like nightmare. I don’t know, maybe Haml is better designed than Slim. I have similar experience with yaml, it’s also indentation-based and has lots of syntax sugar. Had the same problems and frustration with it.

        Editing erb templates (with help of editor extensions) feels so relieving after Slim.

        1. 3

          I would never mix Slim and Markdown. It would be simply impossible to differentiate one from another. Haml and Markdown have not that many clashes in syntax.