HTML Renderer - java-html-renderer

advertisement
Customer Requirements (revised)

The renderer should be capable of reading and displaying a document written in HTML, including the
extensions added by Netscape.

The renderer should be given the name of an HTML file, either via a command-line argument or via a
graphical user interface. It should then render the HTML document in a window of its own. The window
should also display an indication of whether the page conforms to the HTML specification.

If the document is too long to fit in the window, a vertical scroll bar should be provided to allow the user to
view the entire document. Ordinary breakable lines of HTML text should be broken so as to fit within the
width of the window. Only in cases in which a line cannot be broken to fit within the width of the window, such
as a long line of preformatted text, should a horizontal scroll bar be provided.

The user should be able to close the document window, terminating the program.

The contents of the <title>...</title> tag should be displayed in the window's title.

The <p> tag ends the current paragraph and outputs a blank line. The following text starts at the beginning of
the next line.

The <hn> tag ends the current paragraph and outputs a blank line and an nth level heading number, and
begins an nth level heading. Heading numbers are lists of arabic numerals followed by full stops, for example:
1. is a 1st level heading number.
1.2. is a 2nd level heading number.
1.2.3. is a 3rd level heading number.
etc.

The </hn> tag ends an nth level heading.

If the heading is longer than one line, it should be wrapped and the following line indented by the width of the
heading number.
For example, the document:
<h1>A heading</h1>
<h2>A subheading</h2>
<h2>A very very very very very very very very very very very very very very
very very very long subheading</h2>
A paragraph of text.
<p>
Another, rather longer, paragraph of text.
Note
that
line-breaking and
spaces
are unimportant.
Customer Requirements  HTML Renderer
Software Engineering  House 2
Page 1 of 5
Should be rendered as:
1. A heading
1.1. A subheading
1.2. A very very very very very very very very very very very very very very very very very long subheading
A paragraph of text.
Another, rather longer, paragraph of text. Note that line-breaking and spaces are unimportant.

The renderer should be able to format numbered and un-numbered lists, for example:
<ul>
<li> Some text
<li> Some more text with quite long lines that go on and on
and on and on and on, and includes another list:
<ol>
<li> Some text
<li> Some more text
</ol>
<li> Er.
<li> That's it.
</ul>
Should be rendered as:
• Some text
• Some more text with quite long lines that go on and on and on and
on and on, and includes another list:
1. Some text
2. Some more text
• Er.
• That's it.

The renderer should be able to format definition lists, for example:
<dl>
<dt> NCSA
<dd> NCSA, the National Center for Supercomputing Applications,
is located on the campus of the University of Illinois
at Urbana-Champaign. NCSA is one of the participants in the
National MetaCenter for Computational Science and Engineering.
<dt> Cornell Theory Center
<dd> CTC is located on the campus of Cornell University in Ithaca,
New York. CTC is another participant in the National MetaCenter
for Computational Science and Engineering.
</dl>
Customer Requirements  HTML Renderer
Software Engineering  House 2
Page 2 of 5
Should be rendered as:
NCSA
NCSA, the National Center for Supercomputing Applications, is
located on the campus of the University of Illinois at
Urbana-Champaign. NCSA is one of the participants in the National
MetaCenter for Computational Science and Engineering.
Cornell Theory Center
CTC is located on the campus of Cornell University in Ithaca, New
York. CTC is another participant in the National MetaCenter for
Computational Science and Engineering.

The renderer should be able to format block quotes and centering, for example:
Some quoted text:
<blockquote>
A quotation that can go on for more
than one line if it really feels like it.
</blockquote>
And some centered text:
<center>
Some centered text<br>
Centered text can also go on for more
than one line if it really feels like it.
</center>
Should be formatted as:
Some quoted text:
A quotation that can go on for more than one line if it really
feels like it.
And some centered text:
Some centered text
Centered text can also go on for more than one line if it really feels like it.

The formatter should be able to format pre-formatted text, for example:
<pre>
#!/bin/csh
cd $SCR
cfs get mysrc.f:mycfsdir/mysrc.f
cfs get myinfile:mycfsdir/myinfile
fc -02 -o mya.out mysrc.f
mya.out
cfs save myoutfile:mycfsdir/myoutfile
rm *
</pre>
Customer Requirements  HTML Renderer
Software Engineering  House 2
Page 3 of 5
Should format as:
#!/bin/csh
cd $SCR
cfs get mysrc.f:mycfsdir/mysrc.f
cfs get myinfile:mycfsdir/myinfile
fc -02 -o mya.out mysrc.f
mya.out
cfs save myoutfile:mycfsdir/myoutfile
rm *
Note that entities such as & should still work in a <pre> environment.

The renderer should be able to format horizontal rules. For example,
<hr>
Should be rendered as:

The renderer should format all of the standard entities.

The renderer should be able to format simple tables. For example:
<table border>
<tr>
<td>A</td> <td>B</td> <td>C</td>
</tr>
<tr>
<td>D</td> <td>E</td> <td>F</td>
</tr>
</table>
Should be formatted as:
A
B
C
D
E
F
The renderer must also be able to display an arbitrary number of nested tables -I.e. an unlimited amount of
tables within a table.

The renderer should use the Times New Roman font the default. However, it can recognize and display a
number of basic fonts, if stated in the HTML.

The renderer should understand font tags such as <i>, <b>, <u> and <tt>. They should nest properly, so
<i><b><u> should produce bold italic underlined text.

The renderer must be able to display text in a basic set of colours.

Any tags or entities that are not recognized by the renderer should be ignored. The renderer should not exit
with an error condition.

HTML documents can be arbitrarily long, so the renderer should be capable of reading arbitrarily long
documents.
Customer Requirements  HTML Renderer
Software Engineering  House 2
Page 4 of 5

The renderer should be able to support and display standard image types, i.e. jpeg, gif, png.

There should be a zoom feature, in order to make the text bigger in the display. The user should only have the
ability to zoom in by fixed amounts, i.e. 1.5x, 2x, 3x.

The renderer should be able to display hyper link tags and make them interactive, to enable the user to
navigate around the machinery manual.

As the user navigates around the manual using hyperlinks, they are going to need back and forward buttons so
that they can return to a previous page they were viewing.

There should be an option to enter a kind of debug mode to check the HTML files for the correct use of tags.

The renderer software should be expansible and compatible for keyboard input in case of future upgrades to
the hardware.

A UNIX manual must be provided.
Customer Requirements  HTML Renderer
Software Engineering  House 2
Page 5 of 5
Download