I much prefer HTML and erb.
I much prefer HTML and erb.
Haml is almost the complete opposite IMO, since reading a document formatted with Haml does not result in elegant plain text, and it's not designed specifically for simple use cases.
This mixture of the two really irks me, as a result.
Then I found slim. It eliminates most of the markup, reducing it to its humanly readable essence, producing clean well-formed html.
Writing, and more importantly, reading only the meaningful part of the markup has helped my productivity skyrocket.
My eyes don’t have to struggle to figure out the document structure.
For me, typing full html is no longer an option. Even with emmet I’d have to read it, multiple times, with all the markup syntax poking my eyes.
Slim has been around for years, steadily improving and addressing corner cases.
I absolutely love it. Reduces typing by 50%, reading by 1000+%(as I re-read the code multiple times and it eliminates the multiple takes and looking for closing tags) and matches how my human brain thinks about markup.
Pug (actually Jade at the time) v0.1: Jul 5, 2010
I'm thinking these are "convergent evolution", especially since they arose in different language communities.
I totally agree that this is the best way to generate HTML. I use pug even for really tiny pages and templates. It amazes me that people like JSX, which seems like a total regression from building elements with function calls like React originally had. When I code Cycle.js in coffeescript it looks and feels a lot like pug; which is great.
Web development is complex enough (server side, js, css) without adding an abstraction layer to your markup too.
The problem with HTML is it’s verbose. So folks like to save some keystrokes (and mistakes).
All the "plain text" formatting languages tend to break down. They work until they don't and then somebody invents yet another text-based pseudo-markup language. Asciidoc is best of the worst but fundamentally it's a bad idea. If you're willing to make the investment in tools and training there's a lot of value in enabling people to write real HTML (and MathML) or, better, Docbook + domain-relevant XML that produces real UI-agnostic structured information.
The problem here is that the tools are terrible or expensive or bloated. There's no reason why this should be the case and it's likely a real market opportunity.
The spec for Markdown's syntax includes HTML in its entirety, though...
For example, you can say in SGML that the character '-' at the begin of a line when appearing below a particular parent element should start a line item, using a SGML shortref map/use declaration.
Blends particularly well with markdown eg. where in regular markdown you can use literal HTML, in markown+SGML you can make use of full SGML.
> I prefer just vanilla javascript, css, and html. They work fine, no bloated frameworks!
> What do you do for templates?
> Oh you just pipe it through a really simple shell script I devised. It's just a few lines
> ಠ_ಠ