Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's an interesting idea, but since we have to manually add each network and then it's automatically parsed from that list, at least on my end it wouldn't make any difference at all. Also one of the main features is that you can mix different networks and different threads per network, so that would be really confusing: what does this mean?

    <comment-box network="hackernews reddit" items="11850599 11850500 11859454"></comment-box>
For the Edit: I searched this thorough, custom elements cannot be self-closing. And the closest thing that I found indicates that, even if they could be self-closing (void elements), then they cannot have anything inside (which is also not what I wanted).

See example:

https://jsfiddle.net/franciscop/eo5v6ghc/



> on my end it wouldn't make any difference at all

Sure, but attribute (or tag) names refer the the structure of the document whereas values refer to each special case; structurally (essentially) those two are the same:

    <comment-box hackernews="1">
    <comment-box reddit="4">
but you can't tell because they have different attributes.

Okay, so in order to write (current solution):

    <comment-box hackernews="11850599" reddit="11850500 11859454"></comment-box>
you could do:

    <comment-box network="hackernews" items="11850599"></comment-box>
    <comment-box network="reddit" items="11850500 11859454"></comment-box>
which would work just the same, you just have to group consecutive comment-box into one; or you could even do this:

    <comment-box sources="hackernews: 11850599; reddit: 11850500 11859454"></comment-box>
(inline css style).


The last example of my previous comment is a little ugly; in "real" XML we would write:

    <comment-box>
      <source name="hackernews" items="12"/>
      <source name="reddit" items="24 27"/>
      </comment-box>
which would be very readable; but since we don't have self-closing tags and we need to use hyphens in tag names, it's probably defensible to try to limit the number of tags and put as much information as possible inside attributes...


Totally agree about your conclusion (:

I think that's the same as with the modern <picture> and <video>. I recently tried something similar but in "traditional" html structure, but also found it a bit too verbose for my taste:

https://medium.com/@fpresencia/leveraging-modern-apis-a13fa6...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: