Blobs in Games: Writing HTML by hand

By admin

Tuesday, September 19, 2023
DATE

I write some of my pages using a markup language (

emacs
NORP

org-mode) and other pages using

xhtml
PERSON

, with a few extra x:* tags that get expanded out into html later. I was curious, when I write html by hand, which tags do I use? I used

Python
ORG

‘s elementtree to get the answer:


3085
CARDINAL

p

2466
CARDINAL

a 2303 li 1042 em 1008 code

876
CARDINAL

span

719
CARDINAL

x:

section 517
LAW

br

454
CARDINAL

div

446
CARDINAL

strong

424
CARDINAL

h3

410
CARDINAL

figure

359
CARDINAL

ul

358
CARDINAL

script

331
CARDINAL

img

323
CARDINAL

pre

262
CARDINAL

td

249
CARDINAL

x:document

228
CARDINAL

x:footer

219 g
QUANTITY

A lot of what I write is explanations in <p> paragraphs and <ul> <li> lists. And I try to include lots of <a> links to other supporting documents. I do try to use the semantic <em> and <strong> instead of the visual <i> and <b> . These results didn’t surprise me much.

Here’s the code (roughly):

tag_counts = collections.Counter() for doc in documents: tree = etree.fromstring(doc.contents) for el in tree. iter (): tag_counts [

el.tag] += 1
WORK_OF_ART

for (tag, count) in tag_counts.most_common(20): print (f " {count:5} {tag} " )

Do you write HTML by hand? If so, what tags do you use most?

Update: [

2023-09-20
DATE

] Some people commented on

HackerNews
ORG

about how they write their HTML, including some debate over closing tags, HTML vs XHTML, and markup languages.