Live data from Hacker News

Flat HTML

github.com

21–30 of 48 posts

Re: Flat HTML

#22
post #16

Earlier quoted context omitted.

Come on, this is cutting edge stuff. Personally I've been considering an alternative representation of python using YAML. for example this python: if a == 3: b = y * 3 else: b = x + 4 could be represented in YAML python as: if a == 3: b = y * 3 else: b = x + 4

That is amazing! I hope you can share the toolchain that lets you convert from one to the other so seamlessly?

     I will as soon as the indentation technology has been worked out, and the API stabilized and a documentation framework has been completed, targeting 4/1/21.

Re: Flat HTML

#24
This is great – however, there's space for improvement, namely, flattening the JSON. Readability may also benefit from the addition of a few backslashes added by this procedure. A further step of x-www-form-url encoding or base64 encoding (maybe even as a data-URL?) may also add another as pleasing as satisfying step to you tool chain!

Re: Flat HTML

#26
post #14

Congratulations on re-inventing Emmet (and a bunch of other tools) very badly, I guess? :) For anyone interested, the equivalent of the first example in Emmet is: div>h1{My Post}+ul>li{I am list item $}*3^ul>li{I am a different list item $}*2 It's a lot terser, but since it uses a CSS-like syntax, it's slightly less bizarre than at first glance and not that hard to pick up. Fun tool, more powerful than it looks, and…

Congratulations to yourself as the author reached his target audience and I'm sure the author is happy with your response :D

Re: Flat HTML

#27
Beats JSX. Why have a render() method with all that complicated JSX. Just store this stuff in state. This could be the next hooks. You could add callbacks to this structure too.

    "data": [
        "-h1 =My post",
        "^ul li = I am list item 1",
        "ul li = I am list item 2",
        "ul li = I am list item 3",
        "-ul li = I am a different list item 1",
        { xpathish: "ul li = I am a different list item 2", doer: function() {alert();} }
 ]

Re: Flat HTML

#28

This is great – however, there's space for improvement, namely, flattening the JSON. Readability may also benefit from the addition of a few backslashes added by this procedure. A further step of x-www-form-url encoding or base64 encoding (maybe even as a data-URL?) may also add another as pleasing as satisfying step to you tool chain!

Personally, I'd prefer a more explicit declaration, which is also legitimate CSS, as in:

  html > body > h1 { content: "Example"; }
  html > body > h1 + p { content: "First Paragraph"; }
  html > body > h1 + p + p ( content: "Second Paragraph"; }
  html > body > h1 + p + p + ul > li:first-child { content: "A List Item"; }
  (etc)
Mind how missing content or copy text, like the second paragraph being omitted, may be easily detected!

Re: Flat HTML

#30

Bravo, this is exactly what April Fools' jokes should be. Right on the line where you can think "Well, someone really could be crazy enough to propose this seriously!", where it's close enough that many of the replies here I can't even figure out if they are serious or joking.

I personally prefer the ones that are obviously jokes, but then you look at it for a second and think, "wait, that could actually work..."
Post reply on HN