Live data from Hacker News

Writing HTML by hand

simblob.blogspot.com

61–70 of 76 posts

Re: Writing HTML by hand

#61

I write all my presentations in HTML. Advantages: - greater flexibility than with Markdown; - no need to decide between Markdown, ReStructuredText, Wiki markup, BBCode, etc; Disadvantages: - writing closing tags is cumbersome; The source code is here: https://github.com/ClickHouse/clickhouse-presentations Example: https://presentations.clickhouse.com/meetup74/ai/

> writing closing tags is cumbersome

Personally I've come to appreciate that many closing tags are unnecessary in HTML. Makes many constructs much more concise. Especially with tables:

  
  Some letters and numbers
    Letters Numbers
  
     A 1
     B 2
     C 3
  

Re: Writing HTML by hand

#63
post #16

Earlier quoted context omitted.

The optional form is weird looking coming from the XHTML era where we were trained on the auto-closing form. Looking up elements that support no closing tag: html, head, body, p, li, dt, dd, option, thead, th, tbody, tr, td, tfoot, colgroup Makes sense if you think about it. Basically everything is pretty well defined and its obvious what next tag should close the context. for example obviously ends when you come acr…

> for example obviously ends when you come across another , another , or the required // Only a madman would nest tables!! /me crying in 2000's web design.

Nope, nesting works! The required ending tag on table means any nested table will open a new context and then any or will now scope to that table and will until the second tables closing .

  
  
  
    
    
     table-cell-inside-table
    
  

Re: Writing HTML by hand

#64
post #35

Earlier quoted context omitted.

links are such a pain to write though. Probably the biggest annoyance when I write in raw html.

But is [abc]( http:// ...) any better? I can never remember which brackets to use, and I've been using Markdown for years now. I never have a problem remembering the HTML syntax.

Easy trick to remember it: [Button](url)

The [ and ] are ascii art for a button - in between goes what is clickable (title) and then comes the url.

Re: Writing HTML by hand

#66
Lots of lists on my personal site, even excluding the one non-handcrafted page.

    #!/usr/bin/awk -f
    BEGIN {
        while( (getline t  0) tags[t] = 0
    }
    {
        for (t in tags) tags[t] += gsub("]", "")
    }
    END {
        for (t in tags) print tags[t], t
    }


    ./count.awk $(find . -name '*.html') | sort -rh | head -n 10

      534 li
      290 a
      215 p
      149 br
      132 span
      99 ul
      66 b
      47 div
      40 pre
      37 meta

Re: Writing HTML by hand

#67
post #45

Earlier quoted context omitted.

>I also code SVGs by hand and it's surprisingly easy and straightforward; most (not all, but most) drawings can be approximated by combining elementary shapes (instead of paths). Interesting. Do you have any examples of thise approximations?

Here's the Y of HN that I posted as a comment a couple of months ago: https://news.ycombinator.com/item?id=35898741

Thanks.

Re: Writing HTML by hand

#68

Earlier quoted context omitted.

I'm not sure I understand your question. is the tag you use for an image, and there are tags to embed video.

Yes, it's really simple. And if he meant sizing, "height" and "width" parameters still work in an img-tag: (also the other parameter is set to "auto" automatically, at least in Firefox)

pretty sure you're not supposed to use px in the height attribute. they are pixels.

the width will be set to match the aspect ratio but your browser will have to DL the image first. which probably doesn't matter unless you have content to the left/right of it, then it'll get bumped when the image loads. layout shift is a nasty thing.

Re: Writing HTML by hand

#69

I write all my presentations in HTML. Advantages: - greater flexibility than with Markdown; - no need to decide between Markdown, ReStructuredText, Wiki markup, BBCode, etc; Disadvantages: - writing closing tags is cumbersome; The source code is here: https://github.com/ClickHouse/clickhouse-presentations Example: https://presentations.clickhouse.com/meetup74/ai/

> writing closing tags is cumbersome Personally I've come to appreciate that many closing tags are unnecessary in HTML. Makes many constructs much more concise. Especially with tables: Some letters and numbers Letters Numbers A 1 B 2 C 3

Is there an HTML formatter that'll strip unnecessary closing tags?

I used to be team semi-colon in JS but I've switched teams now and have my formatter strip them. There's like 1 or 2 edge cases where that can bite you but practically speaking it's a non-issue. The real downside is that I sometimes get lazy when writing C++ and that very much dislikes poor punctuation.

Re: Writing HTML by hand

#70
post #35

Earlier quoted context omitted.

links are such a pain to write though. Probably the biggest annoyance when I write in raw html.

But is [abc]( http:// ...) any better? I can never remember which brackets to use, and I've been using Markdown for years now. I never have a problem remembering the HTML syntax.

yes of course.

> I can never remember which brackets to use

and that is patently untrue, as you just demonstrated.

Post reply on HN