From d54f5bc6d078f22d2b54ac1461c1309485fa0573 Mon Sep 17 00:00:00 2001 From: Bill Talcott Date: Thu, 6 Apr 2023 16:41:05 -0400 Subject: [PATCH 01/18] Edits, aim to emphasize key points, ital vs bold --- book/CH03_EffectiveHtml.adoc | 72 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/book/CH03_EffectiveHtml.adoc b/book/CH03_EffectiveHtml.adoc index 927fe62..c3d907f 100644 --- a/book/CH03_EffectiveHtml.adoc +++ b/book/CH03_EffectiveHtml.adoc @@ -9,8 +9,7 @@ WARNING: This chapter is a work in progress. The medium is the message. If you're here, you can probably write some HTML. -The web is the #1 hypermedia system after all, the one this book will spend the most time with, -and HTML is its format. +The web is the #1 hypermedia system after all, and HTML is its format. As with every aspect of the web, it has been exapted and reinterpreted by web developers in myriad ways. Is it a document format? @@ -33,31 +32,31 @@ An HTML file is not a program that produces a human-readable document. It _is_ the document. Unfortunately, HTML's development in terms of hypermedia controls has stagnated -and what little there is often not put to full use. +and, what little there is, is often not put to full use. -This chapter looks at HTML as something worth studying in its own right, even in this day and age. +This chapter looks at HTML as something worth studying in its own right. It covers our best practices for writing/generating HTML, and why HTML is something far cooler than a programming language. -It won't be an HTML tutorial, as that would take a whole other book, but it can accompany you in your HTML re-learning journey. +It won't be an HTML tutorial, but it can accompany you in your HTML re-learning journey. -== Why relearn HTML? +== Why Relearn HTML? Have you noticed that a lot of websites are bad? - - Pages are bloated with `
` soup, and stylesheets are big as a result of trying to select elements in that mess. The result is slow loading times.footnote:[https://almanac.httparchive.org/en/2020/markup] Other than `
` being the most common element, the HTTP Archive Web Almanac found that 0.06% of pages surveyed in 2020 contained the nonexistent `` element. 0.0015% used ``. + - Pages are bloated with `
` soup, and stylesheets are big as a result of trying to select elements in that mess. The result is slow loading times.footnote:[https://almanac.httparchive.org/en/2020/markup] - So-called MVPs (minimum viable product) are released in open beta while being completely unusable by vast swathes of people -- UX not just buggy, but nonexistent.footnote:[https://adrianroselli.com/2022/11/accessibility-gaps-in-mvps.html] Is an inaccessible product "`viable`"? - Websites, including websites containing public data or results of publicly-funded research, are impossible to scrape programmatically. - Search engines have a hard time extracting useful information from a page, and rank that page lower as a result. -In the rest of the chapter, we'll look at these issues in more detail and see how effective HTML can help us develop better websites. -However, we should first note that HTML is not a panacea. -If you care about machine readability, or human readability, or page weight, the most important thing to do is **testing**. +We'll look at these issues in more detail and see how effective HTML can help us develop better websites. +However, we should first note that even good HTML is not a panacea. +If you care about machine readability, or human readability, or page weight, the most important thing to do is _testing_. Test manually. Test automatically. Test with screenreaders, test with a keyboard, test on different browsers and hardware, run linters (while coding and/or in CI). -So where does HTML and the s-word come in? +So why concern ourselves with effective html? Easy. Writing good, spec-compliant HTML lets browsers do a bunch of work for you. Furthermore, even when they don't, it makes it easier to write scripts that do. Fewer issues will be found during testing and you can release faster. When issues do come up, you can often fix them more easily by refactoring HTML as opposed to heaping JavaScript and ARIA attributes over everything. @@ -71,7 +70,7 @@ and many websites settle with _seeming to_ work. But better websites are possible, and anyone can learn HTML to the level of making websites that _actually_ work. -== `
` soup +==
Soup While programming code is described as spaghetti when it's not well organized, the food of choice for messy markup is soupfootnote:[hence BeautifulSoup, the web scraping library.]. @@ -97,7 +96,7 @@ There could be a few reasons: * *Styling.* The `