239 lines
4.3 KiB
HTML
239 lines
4.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Structural markup: a primer</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="DocBook Demystification HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Why care about DocBook at all?"
|
|
HREF="x57.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Document Type Definitions"
|
|
HREF="x97.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>DocBook Demystification HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x57.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x97.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="AEN69"
|
|
></A
|
|
>3. Structural markup: a primer</H1
|
|
><P
|
|
>Older formatting languages like Tex, Texinfo, and Troff
|
|
supported <I
|
|
CLASS="firstterm"
|
|
>presentation
|
|
markup</I
|
|
>. In these systems, the instructions you
|
|
gave were about the appearance and physical layout of the text (font
|
|
changes, indentation changes, that sort of thing).</P
|
|
><P
|
|
>Presentation markup was adequate as long as your objective was
|
|
to print to a single medium or type of display device. You run into
|
|
its limits, however, when you want to mark up a document so that (a)
|
|
it can be formatted for very different display media (such as printing
|
|
vs. Web display), or (b) you want to support searching and indexing the
|
|
document by its logical structure (as you are likely to want to do,
|
|
for example, if you are incorporating it into a hypertext system).</P
|
|
><P
|
|
>To support these capabilities properly, you need a system of
|
|
<I
|
|
CLASS="firstterm"
|
|
>structural markup</I
|
|
>. In structural markup, you describe not
|
|
the physical appearance of the document but the logical properties of
|
|
its parts.</P
|
|
><P
|
|
>As an example: In a presentation-markup language, if you want to
|
|
emphasize a word, you might instruct the formatter to set it in
|
|
boldface. In
|
|
<SPAN
|
|
CLASS="citerefentry"
|
|
><SPAN
|
|
CLASS="refentrytitle"
|
|
>troff</SPAN
|
|
>(1)</SPAN
|
|
>
|
|
this would look like so:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> All your base
|
|
.B are
|
|
belong to us!
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>In a structural-markup language, you would tell the formatter to
|
|
emphasize the word:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> All your base <emphasis>are</emphasis> belong to us!
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> The "<emphasis>" and </emphasis>in the line above
|
|
are called <I
|
|
CLASS="firstterm"
|
|
>markup
|
|
tags</I
|
|
>,
|
|
or just <I
|
|
CLASS="firstterm"
|
|
>tags</I
|
|
> for short. They are the
|
|
instructions to your formatter.</P
|
|
><P
|
|
>In a structural-markup language, the physical appearance of the
|
|
final document would be controlled by a <I
|
|
CLASS="firstterm"
|
|
>stylesheet</I
|
|
>
|
|
. It is the
|
|
stylesheet that would tell the formatter "render emphasis as a font
|
|
change to boldface". One advantage of structural-markup languages
|
|
is that by changing a stylesheet you can globally change the
|
|
presentation of the document (to use different fonts, for example)
|
|
without having to hack all the the individual instances of (say)
|
|
<SPAN
|
|
CLASS="markup"
|
|
>.B</SPAN
|
|
> in the document itself.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x57.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x97.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Why care about DocBook at all?</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Document Type Definitions</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |