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.
It also comes with SASS/SCSS which similarly cleans up stylesheets, and adds things like variables and mixins.
For example, CSS has its own syntax for classes and IDs, and once you're used to that, you can go back to HTML and it can get a little bit frustrating having to do it more verbosely.
And the same with PHP vs JS Or coffee-script, Erlang, etc. vs plenty other languages And the languages that rely on indentation to identify code blocks vs. those that use curly braces or parentheses. The latter is a nightmare when code is nested several blocks deep and you've a sequence of: By the same token there's probably a blog post out there about how confusing concise syntax is and how it's hard to figure out what the hell '{}' or '[]' or '?:' means compared to their more verbose counterparts.