784 lines · 27.4 KB · HTML
RawDownload
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>HTML coding and style guidelines for Ghostscript documentation</title><!-- $Id: Htmstyle.htm,v 1.44 2005/10/20 19:46:23 ray Exp $ --><link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style"></head> <body><!-- [1.0 begin visible header] ============================================ --> <!-- [1.1 begin headline] ================================================== --> <h1>HTML coding and style guidelines for Ghostscript documentation</h1> <!-- [1.1 end headline] ==================================================== --> <!-- [1.2 begin table of contents] ========================================= --> <h2>Table of contents</h2> <blockquote><ul><li><a href="#Introduction">Introduction</a><li><a href="#Appearance">Appearance and contents</a><ul><li><a href="#Page_structure">Page structure</a><li><a href="#Links_outside">Links to outside the Ghostscript documentation</a><li><a href="#Images">Images and graphics</a><li><a href="#index.html"><b><tt>index.html</tt></b></a></ul><li><a href="#Large_structure">HTML large structure</a><ul><li><a href="#HTML_head">HTML <b><tt>&lt;head&gt;</tt></b></a><li><a href="#HTML_body">HTML <b><tt>&lt;body&gt;</tt></b></a></ul><li><a href="#Inner_structure">HTML inner structure</a><ul><li><a href="#Structuring_comments">Structuring comments</a><li><a href="#Headers">Headers: <b><tt>&lt;Hn&gt;</tt></b></a><li><a href="#Anchors">Anchors: <b><tt>&lt;a name="..."&gt;</tt></b></a></ul><li><a href="#Text">The presentation of text</a><ul><li><a href="#Text_sections">Sections of text</a><ul><li><a href="#Paragraphs">Paragraphs: <b><tt>&lt;p&gt;</tt></b></a><li><a href="#Blockquote">Indented paragraphs: <b><tt>&lt;blockquote&gt;</tt></b></a><li><a href="#Line_breaks">Explicit line breaks: <b><tt>&lt;br&gt;</tt></b></a><li><a href="#Preformatted_text">Preformatted text: <b><tt>&lt;pre&gt;</tt></b></a></ul><li><a href="#Use_of_fonts">The use of different font faces</a></ul><li><a href="#Lists">Lists: <b><tt>&lt;ul&gt;, &lt;ol&gt;, &lt;dl&gt;</tt></b></a><li><a href="#Tables">Tables: <b><tt>&lt;table&gt;</tt></b></a><ul><li><a href="#Readability">Readability for the user and the HTML writer</a><li><a href="#Table_guidelines">Specific guidelines for coding tables</a><li><a href="#Typical_table">HTML code for typical tables</a></ul><li><a href="#Unused_tags">Tags not used</a><li><a href="#New_document">Creating a new document</a><ul><li><a href="#File_name">Name the new document in 8+3 format</a><li><a href="#Plagiarize">Use an existing document as a model</a><li><a href="#Readme_material">Write new references to go in <b><tt>Readme.htm</tt></b></a><li><a href="#New_doc_other">Other considerations</a></ul><li><a href="#Miscellany">Miscellany</a></ul></blockquote> <!-- [1.2 end table of contents] =========================================== --> <!-- [1.3 begin hint] ====================================================== --> <p>For other information, see the <a href="Readme.htm">Ghostscriptoverview</a>. <!-- [1.3 end hint] ======================================================== --> <hr> <!-- [1.0 end visible header] ============================================== --> <!-- [2.0 begin contents] ================================================== --> <h2><a name="Introduction"></a>Introduction</h2> <p>The most important intention in casting Ghostscript's documentation intoHypertext Markup Language (HTML) from simple text form is to improve itsusefulness greatly to those who use, install, and build Ghostscript:everything else is details.  The wide spread of World Wide Web browsers nowmakes it possible to distribute documents which are not only readable astext, but also richly cross-linked as hypertext.  Using hypertext through abrowser can reduce the effort required to find and use the informationpeople often need in order to use Ghostscript. <p>The remainder of this document expresses the guidelines used to create theHTML form of the Ghostscript documentation.  The guidelines are intended toencourage <ul><li>documents that are easy to read and understand in all of the most-usedforms: on screen with a browser, printed by a browser, or as plain text; <li>correct HTML that conforms to prevailing standards; <li>consistent HTML coding among all Ghostscript's documents; and <li>HTML documents that are as simple as possible in light of theircontents; free of difficult, little-used, or proprietary constructs; andeasy to understand and modify.</ul> <p>Here are those guidelines. <hr> <h2><a name="Appearance"></a>Appearance and contents</h2> <p>What the user sees browsing the documentation, and what a documentdeveloper or editor sees working with it, are different.  This section isabout what the user sees. <h3><a name="Page_structure"></a>Page structure</h3> <p>A Ghostscript document in HTML form should consist of <ol><li>a visual header containing<ol type=a><li>a conspicuous highlighted headline;<li>a table of contents;<li>"hints": references to other useful documents, always including<a href="Readme.htm">Readme.htm</a>;</ol><li>the substantive contents;<li>a visual trailer consisting entirely of<ol type=a><li>standard copyright and licensing text;<li>the Ghostscript version number; and<li>the date when the document was last modified.</ol></ol> <p>This document is an example of this standard visible structure.  Also seebelow about "<a href="#Structuring_comments">Structuring comments</a>" inHTML source code. <p>Where it makes sense to modify the standard structure to make the documentmore usable, do that.  See<a href="Readme.htm"><b><tt>Readme.htm</tt></b></a> for an example: theintroductory material at the beginning of the visible header, before thetable of contents. <h3><a name="Links_outside"></a>Links to outside the Ghostscript documentation</h3> <p>Links to sites and documents outside the ghostscript distributionmust carry the <code>class="offsite"</code> attribute and value. This signals specialformatting to the stylesheet to assist users reading offline. <p>Avoid gratuitous commercial links; for instance, link the title of a bookto its publisher, not to one particular on-line bookseller. See<a href="Language.htm#Capabilities"><b><tt>Language.htm</tt></b></a> for anexample, the reference to the <em>PostScript Language ReferenceManual</em>. <p>Similarly, where you have a choice, refer to free software rather thancommercial products.  See<a href="Make.htm#Third-party_libraries">Make.htm</a> for an example, thereference to <a href="Make.htm#Third-party_libraries">InfoZip<b><tt>unzip</tt></b></a> (where many commercial products provide similarfunctions). <h3><a name="Images"></a>Images and graphics</h3> <p>Use no graphics or images.  The documents are text-only, so nothing is lostwhen a document is converted into ASCII text.  This is an explicit initialdesign goal of the HTML documentation. <h3><a name="index.html"></a><b><tt>index.html</tt></b></h3> <p><b><tt>index.html</tt></b> is not a part of the visible Ghostscriptdocumentation itself, but when it is placed with all the<b><tt>*.htm</tt></b> files in a directory and a browser refers to thedirectory name alone, most servers are configured to deliver a file named<b><tt>index.html</tt></b> by default.  This one does nothing exceptimmediately to open the introductory Ghostscript document<a href="index.html"><b><tt>Readme.htm</tt></b></a>.  This is intended tomake life easier for both webmasters and users. <hr> <h2><a name="Large_structure"></a>HTML large structure</h2> <h3><a name="HTML_head"></a>HTML <b><tt>&lt;head&gt;</tt></b></h3> <p>Besides the essential HTML structure elements, Ghostscript HTML document's<b><tt>&lt;head&gt;</tt></b> consists of three elements in this order: <ol><li>A <b><tt>&lt;title&gt;</tt></b>, usually the same text as the<a href="#Headline">headline</a> <li>An RCS identification line giving the name of the file in an HTMLcomment: <blockquote><!-- The next line must not contain the literal string $,I,d,:! --><b><tt>&lt;!-- $Id</tt><tt>: </tt></b><b><em>{file name}</em></b><b><tt>.htm $ --&gt;</tt></b></blockquote> <li>For documents converted from another form, an HTML comment line givingthe name of the original file before it was edited and converted to HTML: <blockquote><b><tt>&lt;!-- Originally: </tt></b><b><em>{file name}</em></b><b><tt> --&gt;</tt></b></blockquote></ol> <h3><a name="HTML_body"></a>HTML <b><tt>&lt;body&gt;</tt></b></h3> <p>A Ghostscript HTML document's <b><tt>&lt;body&gt;</tt></b> consists of fiveelements in this order: <ol><li><a name="Headline"></a>The <b><em>headline</em></b> is conspicuous textat the top of the page, usually the same as the<a href="#Structure_head"><b><tt>&lt;title&gt;</tt></b></a> text. It isalways in a table whose purpose is to provide a colored background using<b><tt>bgcolor</tt></b>, going the full width of the page: <blockquote><b><tt>&lt;p&gt;&lt;table width="100%" border="0"&gt;<br>&lt;tr&gt;&lt;th align="center" bgcolor="#CCCC00"&gt;&lt;font size=6&gt;</tt></b><br><b><em>{Text}</em></b><br><b><tt>&lt;/font&gt;<br>&lt;/table&gt;</tt></b></blockquote> <li><a name="Table_of_contents"></a>The <b><em>table of contents</em></b> consists of nested unorderedlists <b><tt>&lt;ul&gt;</tt></b>, in most documents assembled strictly fromthe <b><tt>&lt;Hn&gt;</tt></b> headers.  The levels of nesting in the tableof contents correspond to the level numbers of the headers. <li>The <b><em>hint</em></b> is a short section suggesting where to lookfor other related information.  With very few exceptions this alwaysincludes a reference and link to<a href="Readme.htm"><b><tt>Readme.htm</tt></b></a>, but may include othersuggestions and references. <li>The substance of the document. <li>The <b><em>trailer</em></b> contains, in a small font size, <ol type=a><li>the <b><em>copyright notice</em></b> and other legal boilerplate text<li>the <b><em>version number</em></b> of Ghostscript and the<b><em>date</em></b> when the file was last modified.</ol></ol> <p>This document for an example of that structure. <hr> <h2><a name="Inner_structure"></a>HTML inner structure</h2> <h3><a name="Structuring_comments"></a>Structuring comments</h3> <p>Special comment lines within the HTML files mark internally the visiblesections of the document.  They make it easy for both document developersand programs to handle the HTML code.  Each of these comments is exactly 80characters wide, and each important section of a document is bracketed by aunique beginning and ending pair.  View the source code of this documentfor an example of these structuring comments.  The sections they mark are: <ol><li>the <b><em>visible header</em></b><ol type=a><li>the <a href="#Headline"><b><em>headline</em></b></a><li>the <b><em>table of contents</em></b><li>the "see also" <b><em>hints</em></b></ol><li>the <b><em>body</em></b><li>the <b><em>trailer</em></b></ol> <h3><a name="Headers"></a>Headers: <b><tt>&lt;Hn&gt;</tt></b></h3> <p>Give a header <b><tt>&lt;Hn&gt;</tt></b> this structure: <blockquote><b><tt>&lt;h2&gt;&lt;a name="Head_anchor"&gt;&lt;/a&gt;Header text&lt;/h2&gt;</tt></b></blockquote> <p>That is, the opening header tag, an anchor, the header text, and theclosing tag. <p>Represent every header in the table of contents, linked<b><tt>&lt;a&nbsp;href="#..."&gt;</tt></b>...<b><tt>&lt;/a&gt;</tt></b> tothe header.  Of course, the headers are also convenient linkage points forreferences from other documents. <h3><a name="Anchors"></a>Anchors: <b><tt>&lt;a name="..."&gt;</tt></b></h3> <p>Give an anchor a name consisting only of letters, digits, dots("<b><tt>.</tt></b>"), hyphens ("<b><tt>-</tt></b>"), and underscores("<b><tt>_</tt></b>"), but not white space or other punctuation marks.This ensures that the name is readable and that an entire name alwaysappears on a single line of HTML source both where it's defined andeverywhere it's used, making it simple to find anchors by text search inthe HTML source code. <p>Choose anchor names to be readable and meaningful in the HTML source code.For instance: <blockquote><table cellpadding=0 cellspacing=0><tr valign=bottom>	<th align=left>Use this form	<td>&nbsp;&nbsp;&nbsp;&nbsp;	<th align=left>... <b><em>NOT</em></b> this form<tr>	<td colspan=3><hr><tr valign=top>	<td><b><tt>&lt;a&nbsp;name="Image_formats"&gt;&lt;/a&gt;</tt></b>	<td>&nbsp;	<td><b><tt>&lt;a&nbsp;name="Imgfts"&gt;&lt;/a&gt;</tt></b></table></blockquote> <p>Anchors should be empty, that is <blockquote><table cellpadding=0 cellspacing=0><tr valign=bottom>	<th align=left>Use this form	<td>&nbsp;&nbsp;&nbsp;&nbsp;	<th align=left>... <b><em>NOT</em></b> this form<tr>	<td colspan=3><hr><tr valign=top>	<td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>	<td>&nbsp;	<td><b><tt>&lt;a&nbsp;name="..."&gt;</tt></b><b><em>anything</em></b><b><tt>&lt;/a&gt;</tt></b></table></blockquote> <p><a name="Anchor_placement"></a>Place an anchor within a paragraph (indentedparagraph, list item, head, etc.) and at its beginning. <blockquote><table cellpadding=0 cellspacing=0><tr valign=bottom>	<th align=left>Use this form	<td>&nbsp;&nbsp;&nbsp;&nbsp;	<th align=left>... <b><em>NOT</em></b> this form<tr>	<td colspan=3><hr><tr valign=top>	<td><b><tt>&lt;p&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>	<td>&nbsp;	<td><b><tt>&lt;p&gt;</tt></b><b><em>&nbsp;...text...&nbsp;</em></b><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b><tr valign=top>	<td><b><tt>&lt;p&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>	<td>&nbsp;	<td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;&lt;p&gt;</tt></b><tr valign=top>	<td><b><tt>&lt;li&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>	<td>&nbsp;	<td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;&lt;li&gt;</tt></b></table></blockquote> <hr> <h2><a name="Text"></a>The presentation of text</h2> <h3><a name="Text_sections"></a>Sections of text</h3> <h4><a name="Paragraphs"></a>Paragraphs: <b><tt>&lt;p&gt;</tt></b></h4> <p>Define unindented paragraphs with <b><tt>&lt;p&gt;</tt></b>, never withexplicit line breaks <b><tt>&lt;br&gt;</tt></b>, and make themragged-right, not right-filled or centered.  Put the paragraph tag<b><tt>&lt;p&gt;</tt></b> on a line alone, except when it is<a href="#Anchor_placement">followed immediately by an anchor</a>.Don't place the anchor before the paragraph tag. <h4><a name="Blockquote"></a>Indented paragraphs: <b><tt>&lt;blockquote&gt;</tt></b></h4> <p>Define indented paragraphs with <b><tt>&lt;blockquote&gt;</tt></b>.  Avoidelaborate nested indentation -- that is, more than two levels.  It isgenerally a poor idea to try to make indentation carry too much weight ofmeaning for text, so use indentation simply to separate visual elements foreasier reading. <h4><a name="Line_breaks"></a>Explicit line breaks: <b><tt>&lt;br&gt;</tt></b></h4> <p>Use explicit line breaks <b><tt>&lt;br&gt;</tt></b> sparingly, and never asa substitute for paragraph tags.  Do use them in <ul><li>multi-line addresses<li>formatted coding examples<li>table entries, sparingly</ul> <h4><a name="Preformatted_text"></a>Preformatted text: <b><tt>&lt;pre&gt;</tt></b></h4> <p>Use preformatted text <b><tt>&lt;pre&gt;</tt></b> exclusively for materialthat must be presented with exact spacing in a monospaced font, such asextended coding examples.  Where extended preformatted text seems likely tobe wider than a typical browser window, reduce the font size: <blockquote><b><tt>&lt;font size="-1"&gt;&lt;pre&gt;</tt></b><br><b><em>...&nbsp;Wide preformatted text&nbsp;...</em></b><br><b><tt>&lt;/pre&gt;&lt;/font&gt;</tt></b></blockquote> <h3><a name="Use_of_fonts"></a>The use of different font faces</h3> <p>Do not use named fonts.  Use only standard markup to specify fonts, asshown in this table. <blockquote><table cellpadding=0 cellspacing=0><tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Use of fonts</font><hr><tr valign=bottom>	<th align=left>Tag	<td>&nbsp;&nbsp;&nbsp;	<th align=left>Used for<tr>	<td colspan=3><hr><tr valign=top>	<td><b><tt>&lt;address&gt;</tt></b>	<td>&nbsp;	<td>Addresses in running text<tr valign=top>	<td><b><tt>&lt;b&gt;</tt></b>	<td>&nbsp;	<td>Emphasis everywhere<tr valign=top>	<td><b><tt>&lt;em&gt;</tt></b>	<td>&nbsp;	<td>Emphasis, usually in running text; with <b><tt>&lt;b&gt;</tt></b>, strong emphasis<tr valign=top>	<td><b><tt>&lt;font size=</tt></b><b><em>N</em></b><b><tt>&gt;</tt></b>	<td>&nbsp;	<td>Table headings, extended <b><tt>&lt;pre&gt;</tt></b> examples<tr valign=top>	<td><b><tt>&lt;pre&gt;</tt></b>	<td>&nbsp;	<td>Preformatted text (to control spacing)<tr valign=top>	<td><b><tt>&lt;small&gt;</tt></b>	<td>&nbsp;	<td>Superscripts (smaller than <b><tt>&lt;font size="-1"&gt;</tt></b>)<tr valign=top>	<td><b><tt>&lt;sup&gt;</tt></b>	<td>&nbsp;	<td>Superscripts<tr valign=top>	<td><b><tt>&lt;tt&gt;</tt></b>	<td>&nbsp;	<td>With <b><tt>&lt;b&gt;</tt></b>, used for specific names of	code, programs, and data in running text, and in short examples</table></blockquote> <hr> <h2><a name="Lists"></a>Lists: <b><tt>&lt;ul&gt;, &lt;ol&gt;, &lt;dl&gt;</tt></b></h2> <p>Don't over-use lists: instead simply use clear wording in running textwherever possible.  Use a list where the special formatting improves thematerial's clarity and readability. <p>Most simple lists should be unordered (bulleted) lists<b><tt>&lt;ul&gt;</tt></b>.  Use an ordered (numbered or alphabetized) list<b><tt>&lt;ol&gt;</tt></b> only where the exact ordering or an exact countis important. <p>Where entries in a descriptive list <b><tt>&lt;dl&gt;</tt></b> containextended descriptions <b><tt>&lt;dd&gt;</tt></b> -- especially if thedescriptions contain paragraph breaks or tables -- improve the spacingbetween entries by making each entry a separate list.  That is, encloseeach entry in a separate list to give it more readable spacing, rather thanputting many <b><tt>&lt;dt&gt;...&lt;dd&gt;...</tt></b> entries in a singlelist: 

Lines 1–500 of 784.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t