This document is organised into the following sections:-
Remember: When viewing any HTML document, you can always use a menu
option to view the source to see how it was done!
Introduction
This is not a complete beginner's guide to HTML, for that you should look to the
Help menu of your favourite HTML viewer. Instead, all that is present here is
enough to allow you to update the .html files that make up the SNOMAN Companion.
HTML is a mark-up language, a bit like TeX in that you embed commands in a plain
text file. The basic HTML command looks like this:-
...
where tag_name is some HTML tag. For example the tag 'title' is used to put a
title in the Document Title box at the top of this window. For this document,
the command was:-
HMTL: A Beginner's Guide
Note: tags are not case sensitive; 'TITLE' or even 'TiTlE' work just as well.
The entire document is enclosed within the tag 'html' and is then subdivided
into the two tags 'head', which contains the 'title' tag, and 'body' which
contains the rest. To add comments use:-
and this can be used to include the EXTRACT *file and *endfile lines. The *file
line must include the leading_source keyword so that EXTRACT will allow it to be
preceeded by a little HTML. So, to summarise, the overal framework of any .html
file in this companion looks like this:-
...
....
Headings and Ruled Lines
Headings, of decreasing levels of prominence, have the tags 'h1', 'h2', ...'h6'.
For example:-
This is an H1 Heading
This is an H2 Heading
This is an H3 Heading
This is an H4 Heading
produces:-
This is an H1 Heading
This is an H2 Heading
This is an H3 Heading
This is an H4 Heading
To get a horizontal rule like the one below, use:-
Fonts
To make something boldface use the tag 'b' e.g.
This is in boldface
produces:-
This is in boldface
An in a similar way, use 'i' - italic, 'u' - underline and 'tt' - typewriter
Line and Paragraph Breaks
To force a line break use:-
Normally the viewer will disregard line breaks and puts as much on each line as
the window will allow - trying resizing the window to see this. To force a
paragraph break, use:-
Note that there is no
or
If you want to keep some text exactly as it stands use the 'pre' tag. Its
particularly useful as a simple way of making tables:-
Heading 1 Heading 2
data data
produces:-
Heading 1 Heading 2
data data
Lists
The tag 'ul' produces an unnumbered list where each item has 'li' as it tag. For
example:-
- This is item one
- This is item two
produces:-
- This is item one
- This is item two
In a similar way 'ol' produces an ordered list:-
- This is item one
- This is item two
Links and Anchors
The most powerful feature in HTML is its ability to connect documents together.
In HTML jargon, a LINK is the connection point
that points to an ANCHOR . If you click on the link
above you will jump to the anchor (the jump is so small that you may not see it
unless this text is near the bottom of the window). To define a link, you use
the 'a' tag (a is for anchor), invent a name for a link, say my_link, and decide
what text will be highlighted. For example, to create a link and anchor within
a single document as shown above, the following was used:-
LINK
this will highlight the word LINK, which if clicked, will jump to the anchor
called my_link. To define the anchor use:-
ANCHOR
Note that you have to put a # for the link but not for the anchor. The reason
for this becomes clear when considering links between documents. If you want to
link to another document, say my_other_doc.html, in the same directory, then the
link becomes:-
LINK
So the # acts as a delimiter after the file name. Often, you just want to link
to the start of the file and then, as you might suspect, you just omit the #
part:-
LINK
in this case there is no need for an anchor at all, every document has an
implicit anchor to its start. It is possible to link to documents in other
directories by giving the directory as well as the file name or even to link to
a document on another machine. This is done by using a URL (Uniform Resource
Locator) and is beyond the scope of this beginner's guide (all the companion
.html files are stored in a single directory).
Links in SNOMAN documentation
Links from Companion to User/Programmer Manuals
The User Manual and Programmer Manual are available in HTML form:-
These are created from the latex source files with the latex2html utility, and
are located in separate directories, user_manual and programmer_manual, below
the html directory.
It is clearly a useful thing to have hypertext links from the Companion to the
manuals but this is not straightforward as latex2html creates a large number of
files with nondescript names, eg node32.html. They are also likely to
change each time the manuals are compiled into html. However, the natural thing
to refer to in a link is a latex label rather than a particular file and this
can be done as follows:-
- Make sure there is a latex label defined in the section of the manual you
want to link to (most sections already have labels) eg,
\label{prog_event_loop}
- Create a special link in the companion file of the form
The Programmable Event Loop
The latexref should be the latex label you want to link to. The href
will be set later automatically so it can be left blank for now.
- Set these links at any time with the SET_COMPANION_LINKS tool
set_companion_links.perl -manuals *.html
This command should be run in the html directory.
The tool works by using the labels.pl files which are generated by latex2html
and map latex labels to URLs. They can be found in the user_manual and
programmer_manual directories.
Note that:-
- The `latexref' tag is ignored by browsers as it
is not standard HTML.
- The same label should not appear in both User and Programmer manual as no
distinction between the two is made after the labels.pl files have been loaded
in.
- The links should be updated with the set_companion_links tool every time
the manuals are recompiled into HTML.
The latex2html package, used to generate the on-line versions of the SNOMAN
manuals, provides some special latex commands which can be used to create
hypertext references in the html version of the document. The most useful
command is
\htmladdnormallink{}{}
which makes <text> a hyperlink to <URL>. For example
Note that the `../' was necessary in the URL because the companion files are
in the directory above that of the manuals.
It is simple enough to add links to titles files (.dat) and SNOMAN command
files (.cmd) with the use of relative directory paths
RUN_E_MINUS.CMD
However, some users may prefer not to use the `prod' directory, but instead,
keep everything in `code'. The SET_COMPANION_LINKS tool can be used to switch
over such links from prod to code or vice versa.
set_companion_links.perl -use_code *.html
set_companion_links.perl -use_prod *.html
Go Back to the
Snoman Companion Top Page