Skip to content

Files

Latest commit

 

History

History
29 lines (25 loc) · 1.16 KB

123.md

File metadata and controls

29 lines (25 loc) · 1.16 KB
title date submitter number tags discussion
I want to be able to use condensed HTML syntax
2020-02-21 22:13:18 UTC
Derek Koziol
123
html

I feel HTML is unnecessarily verbose and solutions like Pug and HAML are much more readable. Why not have Pug syntax (or others) natively understood by browsers? Compare:

<div class=""grid"">
  <h1 class=""title"">Some text here</h1>
  <img class=""cover-photo"" src=""https://samplelink"">
  <p class=""description"">Some example description text</p>
</div>

to

.grid
  h1.title Some text here
  img.cover-photo(src='https://samplelink"")
  p.description Some example description text

I don't know why I'd ever choose to write the HTML version, but that's what all our code has to compile to currently. I can imagine a world where Pug (or an alternative) natively just works. HTML is clunky, hard to read, and has so many weird quirks that you just have to learn over time. It doesn't have to be forced (e.g., "everyone must use pug syntax!"), but it could be just become something you could declare in the doctype if you want to write another way.