Hacker News new | ask | show | jobs
by bl 5410 days ago
If you are used to CoffeScript and python and feel like you're trudging through syrup when you work on HTML, you might check out SHPAML (http://shpaml.webfactional.com/). I found SHPAML to be more closely related to those two than HAML and friends: indented syntax, minimal angle brackets, etc. And per your wish:

  div.example_class
    Content here...

  p#id_example
    More content...
From the previous discussions here on HN there were many skeptics, but I have found that it has greatly reduced mental friction when I have to wrestle with HTML: the markup is fast to write, a joy to read, and I get warm, fuzzy feelings knowing that my HTML source is not drowning in markup soup.

Caveats:

1. It doesn't appear to be actively maintained. (But it is distributed as a single, readable python script that one can easily modify to taste. It spits out plain HTML, so if you ever want to ditch SHPAML, you will never be left high and dry.)

2. Doesn't include a round-trip translator. (Not terribly important to me.)

3. Like CoffeeScript and their ilk, the output line numbers don't line up with the source.

4. There are a few bits of gymnastics one has to do to conform to the grammar. For example, a link anchor must appear isolated on a new line to use the most absolutely tersest syntax. Since SHPAML passes HTML straight through, you can avoid this by added the standard markup.

5. SHPAML may not be automatically included in your workflow if you are using something like Rails or Django, but I believe there are a set of github projects that address this.

1 comments

Good old fashioned HAML is regularly maintained, and appears to have been the inspiration for SHPAML:

http://haml-lang.com/

It also comes with SASS/SCSS which similarly cleans up stylesheets, and adds things like variables and mixins.