HACKER Q&A
📣 keepamovin

What if we wrote HTML with [brackets][/brackets]?


As a test I took the markup for our website, dosyago.com, and vimmed it:

  [!DOCTYPE html]
  [html lang="en"]
  [head]
    [meta charset="UTF-8"]
    [meta name="viewport" content="width=device-width, initial-scale=1.0"]
    [link href="poppins.css" rel="stylesheet"]
    [link rel=icon type="image/svg+xml" href="icon.svg"]
    [link rel=stylesheet href="styles.css"]
    [title]BrowserBox Pricing | Open-source Zero Trust Clientless Web Isolation and Secure Document Gateway[/title]
  [/head]
  [body]
    [nav]
      [input type="checkbox" id="menu-btn" class="menu-btn"]
      [div class="logo-container"]
        [img src="icon.svg" alt="BrowserBox logo"]
        [h1]BrowserBox[/h1]
        [span style=width:1em;][/span]
      [/div]
      [label for="menu-btn" class="menu-icon"][span class="nav-icon"][/span][/label]
      [ul class="menu"]
        [li][a href="index.html#features"]Features[/a][/li]
        [li][a href="index.html#pricing"]Pricing[/a][/li]
        [li][a href="mailto:sales@dosyago.com?subject=BrowserBox%20Licensing%20Question"]Contact[/a][/li]
      [/ul]
    [/nav]
    [header]
      [h1]An [span class="highlight"]Upgraded[/span] Web Experience[/h1]
      [h2]Secure and Embeddable[/h2]
      [h3]Deliver fully customizable multiplayer browser experiences with [span class=highlight]BrowserBox[/span][/h3]
    [/header]
    [section id="features"]
      [h2]What You'll Get with Your BrowserBox License[/h2]
      [div class="grid"]
        [div class="card"]
          [h3]The most flexible for building great products[/h3]
          [p]Fully customizable and open source with unrestricted licenses purchasable[/p]
        [/div]
        [div class="card"]
          [h3]Individual Commercial License[/h3]
          [p]Signed by Dosyago for BrowserBox[/p]
        [/div]
        [div class="card"]
          [h3]Source Code[/h3]
          [p]Get [a href=https://github.com/BrowserBox/BrowserBox]the full source code of BrowserBox[/a][/p]
        [/div]
        [div class="card"]
          [h3]Familiar browsing experience[/h3]
          [p]Clear real-time audio and video, tabs, copy paste, view PDFs and more — just like a normal browser[/p]
        [/div]
        [div class="card"]
          [h3]Remote DevTools and Secure Document Gateway[/h3]
          [p]Inspect any page and view any document or zip file[/p]
        [/div]
        [div class="card"]
          [h3]Mobile Just Works[/h3]
          [p]Seamlessly see a mobile version of any page from a mobile device. All languages and IMEs supported[/p]
        [/div]
        [div class="card"]
          [h3]Clientless, embeddable RBI[/h3]
          [p]Zero-download RBI displays in a regular browser. Embed your BrowserBox view in another page, even on mobile.[/p]
        [/div]
        [div class="card"]
          [h3]Multiplayer browsers[/h3]
          [p]Share the same BrowserBox view with friends to collaborate in real time[/p]
        [/div]
        [div class="card"]
          [h3]Zero-Install Browser Extensions[/h3]
          [p]Skip the Webstore and serve your custom extension on BrowserBox to deliver your upgraded experience like that[/p]
        [/div]
      [/div]
    [/section]
    [!-- Call to Action Section --]
    [!-- Video Section --]
    [!-- Pricing Section --]
    
    [!-- snip@ rest html character limit for hn text post !--]
    
    [footer][/footer]
  [/body]
  [/html]

I think it looks pretty good, aesthetically that is. What do others think? I don't know why anyone didn't think of this before. Maybe we just need a new name for it: XMHL - exchanged markup hypertext language .... who knows? :)


  👤 diggan Accepted Answer ✓
Look at that, you almost reinvented `hiccup` (https://github.com/weavejester/hiccup) :)

Taking things a bit further, you get an almost full copy of hiccup, and can save even more space and make it even simpler:

  [div.card
    [h3 "Familiar browsing experience"]
    [p "Clear real-time audio...."]]
Removing the closing elements, make children nested without opening/closing brackets, make strings explicit and you're done! (only difference is hiccup/clojure would make you use :div and :h3 instead, as they're keywords)

👤 neilsimp1
What problem is this solving?

👤 dave4420
I don’t care what colour the bike shed is.

👤 soulchild37
I have been using Karabiner elements (https://karabiner-elements.pqrs.org), they allow keyboard customization, I have switched the colon and semicolon key, by default without pressing shift, the key will output colon (:) , I find this useful as I type lot of colon daily.

Maybe you can use this software to set "<" and ">" to be the default text output without using Shift.


👤 cranberryturkey
basically forum markup aka bbcode?

👤 switch007
Love it - no need to press shift for "<" and ">"

👤 theandrewbailey
Depending on the font and screen you're using, it can be difficult to distinguish between [ and ], and possibly I, l, and 1. The originals < and > are less ambiguous.

👤 kojeovo
After decades of the other brackets it looks super weird