%common; ]> &html.head;
Extra features that I add to HTML are usually done by modifying the declaration. For an HTML file, the declaration must appear as:
]]>
>
I modification add to this declaration, creating a declaration of the form:
... Added declarations go here ... ]>
>’
Other short hand that can be used includes omitting the identifier in the end
tag, so ‘emphasized
text>.]]>>’ is also acceptable. I make great use of this when
marking up headings.
Another legal HTML construct I use is marked sections. Marked
sections are useful for removing large parts of source by
“commenting it out”. Begin the section to remove with
‘>’, and end the section with
‘]]>>’. Remember that marked sections cannot be
nested, and cannot include ‘]]>>’ are parsed literally. I use
CDATA sections in the creation of this document so that I can type HTML
examples without having to escape all the tags. Almost all my documents I create use the same string for the title
of the HTML file, and the level 1 headers (]]>>’ to the
declaration. And I can use this entity for the
This requires modifying the declaration, so the resulting file is no longer legal HTML.
Not all the characters I used in my logic assignment are available as
standard entities in HTML. For example, the double turnstile character
(⊧) is character U+22A7 in Unicode. It is useful to add an
entity for this character to the declaration.
]]>
Many sites have pages that reuse the same headers and footers. I
put the mark-up for my headers and footers in a separate file called
%shared-html;]]>
The sharedHtml.ent file has definitions for entites for headers and
footers. This allows me to use the >, and
> entities in my HTML documents. If I want
to change the headers and footers for my entire site, all I need to do
is modify the sharedHtml.ent file.
A more robust way of referring to entity files is by referring to it
with a FPI (Formal Public Identifier). Instead of adding a system
entity to the HTML, add a public entity.
%shared-html;]]>
The FPI will be resolved by adding the following to your catalog file.
PUBLIC "-//Russell O'Connor//ENTITIES Shared HTML//EN" sharedHtml.ent
Using the features that do not modify the declaration of HTML
produces legal HTML. But there are very few browsers that correctly
handle HTML that uses such short hand. If the HTML declaration is
modified, then the resulting file is not even legal HTML. The solution
to both these problems is by using a program called
sgmlnorm -d -c
sgmlnorm will need In writing up a mathematical assignment, superscript and subscripts
are often used. For the variable x> repeatedly is a bit tedious. One option
is to use entities for variables. Another option is to use the SHORTTAG
features described in SGML and HTML
Explained>>. This allows the subscripts and superscripts to be
delimited by the ‘_’, and ‘^’ characters.
This allows xx_0_>.
Instead of restricting the use of these delimiters to the MATH
element, I wanted to use it in all block level structures. Here the
declaration needs access to the
]]>...
Other declarations go here
...
%HtmlDtd;
]>
]]>
The HTML DTD is no longer specified in the top-line of the
declaration. Instead an external entity called I did not want line-breaks within the mathematical formulas I was
writing. One method to achieve this is to use the non-breaking space
entity (>) everywhere I wanted a space. This
process is tedious. Instead I added the NBSP element to HTML. This is
simply done by adding it to the list of special inline element and
creating an NBSP element.
]]>
%HtmlDtd;
]]>
]]>
The definition of the NBSP element must occur after the HTML DTD is
instantiated since it refers to entities defined in the HTML DTD. The
same short reference trick used for the SUP and SUB elements can be
used to delimit NBSP sections. I chose the tilde character (~). Also
I specified that inside NBSP element the space character will be a
short reference to the non-breaking space character. The following is
added to the declaration:
]]>
Now all spaces inside NBSP elements (which can be marked by tildes),
will be automatically turned into non-breaking spaces. However, by
adding the NBSP element to the document, it is not valid HTML, even
after running it through sgmlnorm. To get derive valid HTML from my
source, I made use of In an ideal world, to add architectural support for HTML, all that I
would need to do is add the following processing instruction before the
declaration:
The problem with this is that sgmlnorm (and the rest of the programs
in the sp package) currently does not recognize this form of an
architecture declaration. So instead I added the following to the
declaration.
%HtmlDtd;
]]>
The automatic bridging will attach all valid HTML elements to the
HTML architecture. To extract the valid HTML file from within our
modification, the sgmlnorm command is run with the
sgmlnorm -d -A HTML -c
The output is the a perfectly valid HTML, with declaration, and with
the NBSP element removed. But the spaces that were changed to
non-breaking spaces are still there, just as I wanted.
The source file, and resulting file for my math assignment
are available and can be compared. The source for this document can also
be examined.
&html.footer;