Live data from Hacker News

Flat HTML

github.com

1–10 of 48 posts

Re: Flat HTML

#2
What has the world come to if this mess is considered easier than writing some nested html tags? (Perhaps I'm not plugged into the SPA scene well enough to appreciate this project. I hope it is useful to some.) In fact, reading the examples made me check to see if the first commit to this project was today, April Fools...

Re: Flat HTML

#3
Why go through the effort of embedding it in JSON? Why not just send plain text back and forth? If the goal is minimal markup anyway...

That being said, it reminded me of HAML[1] - but that uses whitespace to determine nesting.

[1] http://haml.info/

Re: Flat HTML

#4

What has the world come to if this mess is considered easier than writing some nested html tags? (Perhaps I'm not plugged into the SPA scene well enough to appreciate this project. I hope it is useful to some.) In fact, reading the examples made me check to see if the first commit to this project was today, April Fools...

I really hope it's a joke. I mean it's not even flat. It's just the nesting is represented in a different less intuitive way.

Re: Flat HTML

#6
I think the idea is a little rough around the edges but it has good bones. I think a better name might be something like "procedural HTML" since I think you're envisioning something like

    add paragraph "content"
    push division
    add image
    add attr src "https://..."
    add attr alt "cute cat"
    add paragraph "more content"
    pop division
    ...
But obviously with much terser syntax. Everyone seems to be on the declarative train these days that it's nice to see some interesting procedural work.

Such a thing composes pretty nicely too since basically any sequence of statements grouped together can be used as a component.

Re: Flat HTML

#7

Why go through the effort of embedding it in JSON? Why not just send plain text back and forth? If the goal is minimal markup anyway... That being said, it reminded me of HAML[1] - but that uses whitespace to determine nesting. [1] http://haml.info/

Or this-

https://github.com/pugjs/pug/blob/master/README.md#syntax

Re: Flat HTML

#8
I don't think I get the point? It's even more convoluted than haml, which is already pretty well established, and the syntax is subtly different enough that I can see myself tripping repeatedly while trying to write this.

Is this an exercise? Is there an actual project somewhere doing it?

Re: Flat HTML

#9

What has the world come to if this mess is considered easier than writing some nested html tags? (Perhaps I'm not plugged into the SPA scene well enough to appreciate this project. I hope it is useful to some.) In fact, reading the examples made me check to see if the first commit to this project was today, April Fools...

The reason behind the design is not mentioned. Why would one take this seriously?
Post reply on HN