Structured Data for the Web
The immense popularity of the World Wide Web makes it desirable to be able to present data like the office directory developed in the last section in a form that is a bit fancier than our simple text file.
Web files are mostly written in a markup language called HyperText Markup Language (HTML). This is a family of languages that are specific instances of the Standard Generalized Markup Language (SGML), which has been defined in several ISO standards since 1986. The manuscript for this book was written in DocBook/XML, which is also a specific instance of SGML. You can find a full description of HTML in HTML & XHTML: The Definitive Guide (O'Reilly).[4]
For the purposes of this section, we need only a tiny subset of HTML, which we present here in a small tutorial. If you are already familiar with HTML, just skim the next page or two.
Here is a minimal standards-conformant HTML file produced by a useful tool written by one of us:[5]
$ echo Hello, world. | html-pretty
<!-- -*-html-*- -->
<!-- Prettyprinted by html-pretty flex version 1.01 [25-Aug-2001] -->
<!-- on Wed Jan 8 12:12:42 2003 -->
<!-- for Adrian W. Jones (jones@example.com) -->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<TITLE>
<!-- Please supply a descriptive title here -->
</TITLE>
<!-- Please supply a correct e-mail address here -->
<LINK REV="made" HREF="mailto:jones@example.com">
</HEAD>
<BODY>
Hello, world.
</BODY>
</HTML>
The points to note in this HTML output are:
HTML ...
Get Classic Shell Scripting now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.