Htmstyle.htm 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>HTML coding and style guidelines for Ghostscript documentation</title>
  6. <!-- $Id: Htmstyle.htm,v 1.18.2.2 2002/02/01 05:31:25 raph Exp $ -->
  7. <link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
  8. </head>
  9. <body>
  10. <!-- [1.0 begin visible header] ============================================ -->
  11. <!-- [1.1 begin headline] ================================================== -->
  12. <h1>HTML coding and style guidelines for Ghostscript documentation</h1>
  13. <!-- [1.1 end headline] ==================================================== -->
  14. <!-- [1.2 begin table of contents] ========================================= -->
  15. <h2>Table of contents</h2>
  16. <blockquote><ul>
  17. <li><a href="#Introduction">Introduction</a>
  18. <li><a href="#Appearance">Appearance and contents</a>
  19. <ul>
  20. <li><a href="#Page_structure">Page structure</a>
  21. <li><a href="#Links_outside">Links to outside the Ghostscript documentation</a>
  22. <li><a href="#Images">Images and graphics</a>
  23. <li><a href="#index.html"><b><tt>index.html</tt></b></a>
  24. </ul>
  25. <li><a href="#Large_structure">HTML large structure</a>
  26. <ul>
  27. <li><a href="#HTML_head">HTML <b><tt>&lt;head&gt;</tt></b></a>
  28. <li><a href="#HTML_body">HTML <b><tt>&lt;body&gt;</tt></b></a>
  29. </ul>
  30. <li><a href="#Inner_structure">HTML inner structure</a>
  31. <ul>
  32. <li><a href="#Structuring_comments">Structuring comments</a>
  33. <li><a href="#Headers">Headers: <b><tt>&lt;Hn&gt;</tt></b></a>
  34. <li><a href="#Anchors">Anchors: <b><tt>&lt;a name="..."&gt;</tt></b></a>
  35. </ul>
  36. <li><a href="#Text">The presentation of text</a>
  37. <ul>
  38. <li><a href="#Text_sections">Sections of text</a>
  39. <ul>
  40. <li><a href="#Paragraphs">Paragraphs: <b><tt>&lt;p&gt;</tt></b></a>
  41. <li><a href="#Blockquote">Indented paragraphs: <b><tt>&lt;blockquote&gt;</tt></b></a>
  42. <li><a href="#Line_breaks">Explicit line breaks: <b><tt>&lt;br&gt;</tt></b></a>
  43. <li><a href="#Preformatted_text">Preformatted text: <b><tt>&lt;pre&gt;</tt></b></a>
  44. </ul>
  45. <li><a href="#Use_of_fonts">The use of different font faces</a>
  46. </ul>
  47. <li><a href="#Lists">Lists: <b><tt>&lt;ul&gt;, &lt;ol&gt;, &lt;dl&gt;</tt></b></a>
  48. <li><a href="#Tables">Tables: <b><tt>&lt;table&gt;</tt></b></a>
  49. <ul>
  50. <li><a href="#Readability">Readability for the user and the HTML writer</a>
  51. <li><a href="#Table_guidelines">Specific guidelines for coding tables</a>
  52. <li><a href="#Typical_table">HTML code for typical tables</a>
  53. </ul>
  54. <li><a href="#Unused_tags">Tags not used</a>
  55. <li><a href="#New_document">Creating a new document</a>
  56. <ul>
  57. <li><a href="#File_name">Name the new document in 8+3 format</a>
  58. <li><a href="#Plagiarize">Use an existing document as a model</a>
  59. <li><a href="#Readme_material">Write new references to go in <b><tt>Readme.htm</tt></b></a>
  60. <li><a href="#New_doc_other">Other considerations</a>
  61. </ul>
  62. <li><a href="#Miscellany">Miscellany</a>
  63. </ul></blockquote>
  64. <!-- [1.2 end table of contents] =========================================== -->
  65. <!-- [1.3 begin hint] ====================================================== -->
  66. <p>For other information, see the <a href="Readme.htm">Ghostscript
  67. overview</a>.
  68. <!-- [1.3 end hint] ======================================================== -->
  69. <hr>
  70. <!-- [1.0 end visible header] ============================================== -->
  71. <!-- [2.0 begin contents] ================================================== -->
  72. <h2><a name="Introduction"></a>Introduction</h2>
  73. <p>
  74. The most important intention in casting Ghostscript's documentation into
  75. Hypertext Markup Language (HTML) from simple text form is to improve its
  76. usefulness greatly to those who use, install, and build Ghostscript:
  77. everything else is details. The wide spread of World Wide Web browsers now
  78. makes it possible to distribute documents which are not only readable as
  79. text, but also richly cross-linked as hypertext. Using hypertext through a
  80. browser can reduce the effort required to find and use the information
  81. people often need in order to use Ghostscript.
  82. <p>
  83. The remainder of this document expresses the guidelines used to create the
  84. HTML form of the Ghostscript documentation. The guidelines are intended to
  85. encourage
  86. <ul>
  87. <li>documents that are easy to read and understand in all of the most-used
  88. forms: on screen with a browser, printed by a browser, or as plain text;
  89. <li>correct HTML that conforms to prevailing standards;
  90. <li>consistent HTML coding among all Ghostscript's documents; and
  91. <li>HTML documents that are as simple as possible in light of their
  92. contents; free of difficult, little-used, or proprietary constructs; and
  93. easy to understand and modify.
  94. </ul>
  95. <p>
  96. Here are those guidelines.
  97. <hr>
  98. <h2><a name="Appearance"></a>Appearance and contents</h2>
  99. <p>
  100. What the user sees browsing the documentation, and what a document
  101. developer or editor sees working with it, are different. This section is
  102. about what the user sees.
  103. <h3><a name="Page_structure"></a>Page structure</h3>
  104. <p>
  105. A Ghostscript document in HTML form should consist of
  106. <ol>
  107. <li>a visual header containing
  108. <ol type=a>
  109. <li>a conspicuous highlighted headline;
  110. <li>a table of contents;
  111. <li>"hints": references to other useful documents, always including
  112. <a href="Readme.htm">Readme.htm</a>;
  113. </ol>
  114. <li>the substantive contents;
  115. <li>a visual trailer consisting entirely of
  116. <ol type=a>
  117. <li>standard copyright and licensing text;
  118. <li>the Ghostscript version number; and
  119. <li>the date when the document was last modified.
  120. </ol>
  121. </ol>
  122. <p>
  123. This document is an example of this standard visible structure. Also see
  124. below about "<a href="#Structuring_comments">Structuring comments</a>" in
  125. HTML source code.
  126. <p>
  127. Where it makes sense to modify the standard structure to make the document
  128. more usable, do that. See
  129. <a href="Readme.htm"><b><tt>Readme.htm</tt></b></a> for an example: the
  130. introductory material at the beginning of the visible header, before the
  131. table of contents.
  132. <h3><a name="Links_outside"></a>Links to outside the Ghostscript documentation</h3>
  133. <p>
  134. Links to sites and documents outside the ghostscript distribution
  135. must carry the <code>class="offsite"</code> attribute and value. This signals special
  136. formatting to the stylesheet to assist users reading offline.
  137. <p>
  138. Avoid gratuitous commercial links; for instance, link the title of a book
  139. to its publisher, not to one particular on-line bookseller. See
  140. <a href="Language.htm#Capabilities"><b><tt>Language.htm</tt></b></a> for an
  141. example, the reference to the <em>PostScript Language Reference
  142. Manual</em>.
  143. <p>
  144. Similarly, where you have a choice, refer to free software rather than
  145. commercial products. See
  146. <a href="Make.htm#Third-party_libraries">Make.htm</a> for an example, the
  147. reference to <a href="Make.htm#Third-party_libraries">InfoZip
  148. <b><tt>unzip</tt></b></a> (where many commercial products provide similar
  149. functions).
  150. <h3><a name="Images"></a>Images and graphics</h3>
  151. <p>
  152. Use no graphics or images. The documents are text-only, so nothing is lost
  153. when a document is converted into ASCII text. This is an explicit initial
  154. design goal of the HTML documentation.
  155. <h3><a name="index.html"></a><b><tt>index.html</tt></b></h3>
  156. <p>
  157. <b><tt>index.html</tt></b> is not a part of the visible Ghostscript
  158. documentation itself, but when it is placed with all the
  159. <b><tt>*.htm</tt></b> files in a directory and a browser refers to the
  160. directory name alone, most servers are configured to deliver a file named
  161. <b><tt>index.html</tt></b> by default. This one does nothing except
  162. immediately to open the introductory Ghostscript document
  163. <a href="index.html"><b><tt>Readme.htm</tt></b></a>. This is intended to
  164. make life easier for both webmasters and users.
  165. <hr>
  166. <h2><a name="Large_structure"></a>HTML large structure</h2>
  167. <h3><a name="HTML_head"></a>HTML <b><tt>&lt;head&gt;</tt></b></h3>
  168. <p>
  169. Besides the essential HTML structure elements, Ghostscript HTML document's
  170. <b><tt>&lt;head&gt;</tt></b> consists of three elements in this order:
  171. <ol>
  172. <li>A <b><tt>&lt;title&gt;</tt></b>, usually the same text as the
  173. <a href="#Headline">headline</a>
  174. <li>An RCS identification line giving the name of the file in an HTML
  175. comment:
  176. <blockquote>
  177. <!-- The next line must not contain the literal string $,I,d,:! -->
  178. <b><tt>&lt;!-- $Id</tt><tt>: </tt></b><b><em>{file name}</em></b><b><tt>.htm $ --&gt;</tt></b>
  179. </blockquote>
  180. <li>For documents converted from another form, an HTML comment line giving
  181. the name of the original file before it was edited and converted to HTML:
  182. <blockquote>
  183. <b><tt>&lt;!-- Originally: </tt></b><b><em>{file name}</em></b><b><tt> --&gt;</tt></b>
  184. </blockquote>
  185. </ol>
  186. <h3><a name="HTML_body"></a>HTML <b><tt>&lt;body&gt;</tt></b></h3>
  187. <p>
  188. A Ghostscript HTML document's <b><tt>&lt;body&gt;</tt></b> consists of five
  189. elements in this order:
  190. <ol>
  191. <li><a name="Headline"></a>The <b><em>headline</em></b> is conspicuous text
  192. at the top of the page, usually the same as the
  193. <a href="#Structure_head"><b><tt>&lt;title&gt;</tt></b></a> text. It is
  194. always in a table whose purpose is to provide a colored background using
  195. <b><tt>bgcolor</tt></b>, going the full width of the page:
  196. <blockquote>
  197. <b><tt>&lt;p&gt;&lt;table width="100%" border="0"&gt;<br>
  198. &lt;tr&gt;&lt;th align="center" bgcolor="#CCCC00"&gt;&lt;font size=6&gt;</tt></b><br>
  199. <b><em>{Text}</em></b><br>
  200. <b><tt>&lt;/font&gt;<br>
  201. &lt;/table&gt;</tt></b>
  202. </blockquote>
  203. <li><a name="Table_of_contents"></a>
  204. The <b><em>table of contents</em></b> consists of nested unordered
  205. lists <b><tt>&lt;ul&gt;</tt></b>, in most documents assembled strictly from
  206. the <b><tt>&lt;Hn&gt;</tt></b> headers. The levels of nesting in the table
  207. of contents correspond to the level numbers of the headers.
  208. <li>The <b><em>hint</em></b> is a short section suggesting where to look
  209. for other related information. With very few exceptions this always
  210. includes a reference and link to
  211. <a href="Readme.htm"><b><tt>Readme.htm</tt></b></a>, but may include other
  212. suggestions and references.
  213. <li>The substance of the document.
  214. <li>The <b><em>trailer</em></b> contains, in a small font size,
  215. <ol type=a>
  216. <li>the <b><em>copyright notice</em></b> and other legal boilerplate text
  217. <li>the <b><em>version number</em></b> of Ghostscript and the
  218. <b><em>date</em></b> when the file was last modified.
  219. </ol>
  220. </ol>
  221. <p>
  222. This document for an example of that structure.
  223. <hr>
  224. <h2><a name="Inner_structure"></a>HTML inner structure</h2>
  225. <h3><a name="Structuring_comments"></a>Structuring comments</h3>
  226. <p>
  227. Special comment lines within the HTML files mark internally the visible
  228. sections of the document. They make it easy for both document developers
  229. and programs to handle the HTML code. Each of these comments is exactly 80
  230. characters wide, and each important section of a document is bracketed by a
  231. unique beginning and ending pair. View the source code of this document
  232. for an example of these structuring comments. The sections they mark are:
  233. <ol>
  234. <li>the <b><em>visible header</em></b>
  235. <ol type=a>
  236. <li>the <a href="#Headline"><b><em>headline</em></b></a>
  237. <li>the <b><em>table of contents</em></b>
  238. <li>the "see also" <b><em>hints</em></b>
  239. </ol>
  240. <li>the <b><em>body</em></b>
  241. <li>the <b><em>trailer</em></b>
  242. </ol>
  243. <h3><a name="Headers"></a>Headers: <b><tt>&lt;Hn&gt;</tt></b></h3>
  244. <p>
  245. Give a header <b><tt>&lt;Hn&gt;</tt></b> this structure:
  246. <blockquote><b><tt>
  247. &lt;h2&gt;&lt;a name="Head_anchor"&gt;&lt;/a&gt;Header text&lt;/h2&gt;
  248. </tt></b></blockquote>
  249. <p>
  250. That is, the opening header tag, an anchor, the header text, and the
  251. closing tag.
  252. <p>
  253. Represent every header in the table of contents, linked
  254. <b><tt>&lt;a&nbsp;href="#..."&gt;</tt></b>...<b><tt>&lt;/a&gt;</tt></b> to
  255. the header. Of course, the headers are also convenient linkage points for
  256. references from other documents.
  257. <h3><a name="Anchors"></a>Anchors: <b><tt>&lt;a name="..."&gt;</tt></b></h3>
  258. <p>
  259. Give an anchor a name consisting only of letters, digits, dots
  260. ("<b><tt>.</tt></b>"), hyphens ("<b><tt>-</tt></b>"), and underscores
  261. ("<b><tt>_</tt></b>"), but not white space or other punctuation marks.
  262. This ensures that the name is readable and that an entire name always
  263. appears on a single line of HTML source both where it's defined and
  264. everywhere it's used, making it simple to find anchors by text search in
  265. the HTML source code.
  266. <p>
  267. Choose anchor names to be readable and meaningful in the HTML source code.
  268. For instance:
  269. <blockquote><table cellpadding=0 cellspacing=0>
  270. <tr valign=bottom>
  271. <th align=left>Use this form
  272. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  273. <th align=left>... <b><em>NOT</em></b> this form
  274. <tr> <td colspan=3><hr>
  275. <tr valign=top> <td><b><tt>&lt;a&nbsp;name="Image_formats"&gt;&lt;/a&gt;</tt></b>
  276. <td>&nbsp;
  277. <td><b><tt>&lt;a&nbsp;name="Imgfts"&gt;&lt;/a&gt;</tt></b>
  278. </table></blockquote>
  279. <p>
  280. Anchors should be empty, that is
  281. <blockquote><table cellpadding=0 cellspacing=0>
  282. <tr valign=bottom>
  283. <th align=left>Use this form
  284. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  285. <th align=left>... <b><em>NOT</em></b> this form
  286. <tr> <td colspan=3><hr>
  287. <tr valign=top> <td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>
  288. <td>&nbsp;
  289. <td><b><tt>&lt;a&nbsp;name="..."&gt;</tt></b><b><em>anything</em></b><b><tt>&lt;/a&gt;</tt></b>
  290. </table></blockquote>
  291. <p>
  292. <a name="Anchor_placement"></a>Place an anchor within a paragraph (indented
  293. paragraph, list item, head, etc.) and at its beginning.
  294. <blockquote><table cellpadding=0 cellspacing=0>
  295. <tr valign=bottom>
  296. <th align=left>Use this form
  297. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  298. <th align=left>... <b><em>NOT</em></b> this form
  299. <tr> <td colspan=3><hr>
  300. <tr valign=top> <td><b><tt>&lt;p&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>
  301. <td>&nbsp;
  302. <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>
  303. <tr valign=top> <td><b><tt>&lt;p&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>
  304. <td>&nbsp;
  305. <td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;&lt;p&gt;</tt></b>
  306. <tr valign=top> <td><b><tt>&lt;li&gt;&lt;a&nbsp;name="..."&gt;&lt;/a&gt;</tt></b>
  307. <td>&nbsp;
  308. <td><b><tt>&lt;a&nbsp;name="..."&gt;&lt;/a&gt;&lt;li&gt;</tt></b>
  309. </table></blockquote>
  310. <hr>
  311. <h2><a name="Text"></a>The presentation of text</h2>
  312. <h3><a name="Text_sections"></a>Sections of text</h3>
  313. <h4><a name="Paragraphs"></a>Paragraphs: <b><tt>&lt;p&gt;</tt></b></h4>
  314. <p>
  315. Define unindented paragraphs with <b><tt>&lt;p&gt;</tt></b>, never with
  316. explicit line breaks <b><tt>&lt;br&gt;</tt></b>, and make them
  317. ragged-right, not right-filled or centered. Put the paragraph tag
  318. <b><tt>&lt;p&gt;</tt></b> on a line alone, except when it is
  319. <a href="#Anchor_placement">followed immediately by an anchor</a>.
  320. Don't place the anchor before the paragraph tag.
  321. <h4><a name="Blockquote"></a>Indented paragraphs: <b><tt>&lt;blockquote&gt;</tt></b></h4>
  322. <p>
  323. Define indented paragraphs with <b><tt>&lt;blockquote&gt;</tt></b>. Avoid
  324. elaborate nested indentation -- that is, more than two levels. It is
  325. generally a poor idea to try to make indentation carry too much weight of
  326. meaning for text, so use indentation simply to separate visual elements for
  327. easier reading.
  328. <h4><a name="Line_breaks"></a>Explicit line breaks: <b><tt>&lt;br&gt;</tt></b></h4>
  329. <p>
  330. Use explicit line breaks <b><tt>&lt;br&gt;</tt></b> sparingly, and never as
  331. a substitute for paragraph tags. Do use them in
  332. <ul>
  333. <li>multi-line addresses
  334. <li>formatted coding examples
  335. <li>table entries, sparingly
  336. </ul>
  337. <h4><a name="Preformatted_text"></a>Preformatted text: <b><tt>&lt;pre&gt;</tt></b></h4>
  338. <p>
  339. Use preformatted text <b><tt>&lt;pre&gt;</tt></b> exclusively for material
  340. that must be presented with exact spacing in a monospaced font, such as
  341. extended coding examples. Where extended preformatted text seems likely to
  342. be wider than a typical browser window, reduce the font size:
  343. <blockquote>
  344. <b><tt>&lt;font size="-1"&gt;&lt;pre&gt;</tt></b><br>
  345. <b><em>...&nbsp;Wide preformatted text&nbsp;...</em></b><br>
  346. <b><tt>&lt;/pre&gt;&lt;/font&gt;</tt></b>
  347. </blockquote>
  348. <h3><a name="Use_of_fonts"></a>The use of different font faces</h3>
  349. <p>
  350. Do not use named fonts. Use only standard markup to specify fonts, as
  351. shown in this table.
  352. <blockquote><table cellpadding=0 cellspacing=0>
  353. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Use of fonts</font><hr>
  354. <tr valign=bottom>
  355. <th align=left>Tag
  356. <td>&nbsp;&nbsp;&nbsp;
  357. <th align=left>Used for
  358. <tr> <td colspan=3><hr>
  359. <tr valign=top> <td><b><tt>&lt;address&gt;</tt></b>
  360. <td>&nbsp;
  361. <td>Addresses in running text
  362. <tr valign=top> <td><b><tt>&lt;b&gt;</tt></b>
  363. <td>&nbsp;
  364. <td>Emphasis everywhere
  365. <tr valign=top> <td><b><tt>&lt;em&gt;</tt></b>
  366. <td>&nbsp;
  367. <td>Emphasis, usually in running text; with <b><tt>&lt;b&gt;</tt></b>, strong emphasis
  368. <tr valign=top> <td><b><tt>&lt;font size=</tt></b><b><em>N</em></b><b><tt>&gt;</tt></b>
  369. <td>&nbsp;
  370. <td>Table headings, extended <b><tt>&lt;pre&gt;</tt></b> examples
  371. <tr valign=top> <td><b><tt>&lt;pre&gt;</tt></b>
  372. <td>&nbsp;
  373. <td>Preformatted text (to control spacing)
  374. <tr valign=top> <td><b><tt>&lt;small&gt;</tt></b>
  375. <td>&nbsp;
  376. <td>Superscripts (smaller than <b><tt>&lt;font size="-1"&gt;</tt></b>)
  377. <tr valign=top> <td><b><tt>&lt;sup&gt;</tt></b>
  378. <td>&nbsp;
  379. <td>Superscripts
  380. <tr valign=top> <td><b><tt>&lt;tt&gt;</tt></b>
  381. <td>&nbsp;
  382. <td>With <b><tt>&lt;b&gt;</tt></b>, used for specific names of
  383. code, programs, and data in running text, and in short examples
  384. </table></blockquote>
  385. <hr>
  386. <h2><a name="Lists"></a>Lists: <b><tt>&lt;ul&gt;, &lt;ol&gt;, &lt;dl&gt;</tt></b></h2>
  387. <p>
  388. Don't over-use lists: instead simply use clear wording in running text
  389. wherever possible. Use a list where the special formatting improves the
  390. material's clarity and readability.
  391. <p>
  392. Most simple lists should be unordered (bulleted) lists
  393. <b><tt>&lt;ul&gt;</tt></b>. Use an ordered (numbered or alphabetized) list
  394. <b><tt>&lt;ol&gt;</tt></b> only where the exact ordering or an exact count
  395. is important.
  396. <p>
  397. Where entries in a descriptive list <b><tt>&lt;dl&gt;</tt></b> contain
  398. extended descriptions <b><tt>&lt;dd&gt;</tt></b> -- especially if the
  399. descriptions contain paragraph breaks or tables -- improve the spacing
  400. between entries by making each entry a separate list. That is, enclose
  401. each entry in a separate list to give it more readable spacing, rather than
  402. putting many <b><tt>&lt;dt&gt;...&lt;dd&gt;...</tt></b> entries in a single
  403. list:
  404. <blockquote><table cellpadding=0 cellspacing=0>
  405. <tr valign=bottom>
  406. <th align=left>Use this form
  407. <td>&nbsp;&nbsp;&nbsp;&nbsp;
  408. <th align=left>... <b><em>NOT</em></b> this form
  409. <tr> <td colspan=3><hr>
  410. <tr> <td valign=top>
  411. <b><tt>&lt;dl&gt;</tt></b><br>
  412. <b><tt>&lt;dt&gt;</tt></b>Term<br>
  413. <b><tt>&lt;dd&gt;</tt></b>Description<br>
  414. <b><tt>&lt;p&gt;</tt></b>Another paragraph of description<br>
  415. <b><tt>&lt;/dl&gt;</tt></b><br>
  416. &nbsp;<br>
  417. <b><tt>&lt;dl&gt;</tt></b><br>
  418. <b><tt>&lt;dt&gt;</tt></b>Another term<br>
  419. <b><tt>&lt;dd&gt;</tt></b>Another description<br>
  420. <b><tt>&lt;/dl&gt;</tt></b><br>
  421. ...<br>
  422. <td>&nbsp;
  423. <td valign=top>
  424. <b><tt>&lt;dl&gt;</tt></b><br>
  425. <b><tt>&lt;dt&gt;</tt></b>Term<br>
  426. <b><tt>&lt;dd&gt;</tt></b>Description<br>
  427. <b><tt>&lt;p&gt;</tt></b>Another paragraph of description<br>
  428. <b><tt>&lt;dt&gt;</tt></b>Another term<br>
  429. <b><tt>&lt;dd&gt;</tt></b>Another description<br>
  430. ...<br>
  431. <b><tt>&lt;/dl&gt;</tt></b>
  432. </table></blockquote>
  433. <p>
  434. This may be more work for the HTML writer, but the results for the reader
  435. are often much better.
  436. <hr>
  437. <h2><a name="Tables"></a>Tables: <b><tt>&lt;table&gt;</tt></b></h2>
  438. <h3><a name="Readability"></a>Readability for the user and the HTML writer</h3>
  439. <p>
  440. Format tables to be as readable as possible both with a browser and when
  441. converted to plain text. Browsers and converters of all kinds handle
  442. tables idiosyncratically, so there seems to be more art than science to
  443. reaching this end, which accounts for all the detail in the guidelines for
  444. tables: it is the reason for all the uses of background color
  445. <b><tt>bgcolor</tt></b>, horizontal rules <b><tt>&lt;hr&gt;</tt></b>, and
  446. explicit spacing.
  447. <p>
  448. Secondarily, arrange HTML source code for tables to be readable by the
  449. writer and developer.
  450. <h3><a name="Table_guidelines"></a>Specific guidelines for coding tables</h3>
  451. <ul>
  452. <li>Large tables have heads with the same background color as the page's
  453. <a href="#Headline">headline</a>. (Color is used only in tables and only
  454. this way, and it is the same color everywhere. In consideration of
  455. differences of color vision, the color is chosen so that normal black text
  456. contrasts with a brighter background, and the color itself against white.)
  457. <li>Do not use borders for tables; they almost invariably only clutter the
  458. appearance without adding to clarity, and they don't convert well to plain
  459. text. For visual spacing prefer white space.
  460. <li>Set cell padding and spacing to 0. Use explicit white space for
  461. readability, not implicit white space.
  462. <li>Begin the code for a new row <b><tt>&lt;tr&gt;</tt></b> on a new line.
  463. Generally use <b><tt>valign=top</tt></b> to control the placement of text
  464. in a row for readability with a browser or as plain text.
  465. <li>Code the first column of a row beginning on the same line as the
  466. beginning of the row, and then begin every other column on a separate line.
  467. Always precede <b><tt>&lt;td&gt;</tt></b> by a tab character.
  468. <li>Separate two columns of substantive material by a visually empty column
  469. of nonbreaking spaces for readability. Specify the width of this empty
  470. column in the first row, and in all other rows give that column a single
  471. nonbreaking space.
  472. <li>Use horizontal rules and visually empty rows for clarity, but
  473. sparingly. Be consistent with the existing tables.
  474. <li>Give every cell some contents: put a nonbreaking space in a visually
  475. empty cell as a placeholder.
  476. </ul>
  477. <h3><a name="Typical_table"></a>HTML code for typical tables</h3>
  478. <p>
  479. The HTML source code for a typical large table should look like this:
  480. <blockquote>
  481. <pre>&lt;table cellpadding=0 cellspacing=0&gt;
  482. &lt;tr&gt;&lt;th colspan=5 bgcolor="#CCCC00"&gt;&lt;hr&gt;&lt;font size="+1"&gt;Large&nbsp;table&lt;/font&gt;&lt;hr&gt;
  483. &lt;tr&gt; &lt;th align=left&gt;...
  484. &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  485. &lt;th align=left&gt;...
  486. &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  487. &lt;th align=left&gt;...
  488. &lt;tr&gt; &lt;td&gt;...
  489. &lt;td&gt;&amp;nbsp;&amp;nbsp;
  490. &lt;td&gt;...
  491. &lt;td&gt;&amp;nbsp;
  492. &lt;td&gt;...
  493. ...
  494. &lt;/table&gt;
  495. </pre></blockquote>
  496. <p>
  497. The HTML source code for a typical small table should look like this:
  498. <blockquote>
  499. <pre>&lt;table cellpadding=0 cellspacing=0&gt;
  500. &lt;tr&gt; &lt;td&gt;...
  501. &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  502. &lt;td&gt;...
  503. &lt;tr&gt; &lt;td&gt;...
  504. &lt;td&gt;&amp;nbsp;
  505. &lt;td&gt;...
  506. ...
  507. &lt;/table&gt;
  508. </pre></blockquote>
  509. <hr>
  510. <h2><a name="Unused_tags"></a>Tags not used</h2>
  511. <p>
  512. Don't use optional tags (ones not required by the HTML standard). These
  513. include <b><tt>&lt;/dd&gt;</tt></b>, <b><tt>&lt;/dt&gt;</tt></b>,
  514. <b><tt>&lt;/li&gt;</tt></b>, <b><tt>&lt;/p&gt;</tt></b>,
  515. <b><tt>&lt;/tr&gt;</tt></b>, <b><tt>&lt;/th&gt;</tt></b>, and
  516. <b><tt>&lt;/td&gt;</tt></b>.
  517. <hr>
  518. <h2><a name="New_document"></a>Creating a new document</h2>
  519. <h3><a name="File_name"></a>Name the new document in 8+3 format</h3>
  520. <p>
  521. If you create a new Ghostscript HTML document, choose for it a name in 8+3
  522. format for cross-platform compabitility:
  523. <blockquote>
  524. <b><em>Name</em></b><b><tt>.htm</tt></b>
  525. </blockquote>
  526. <p>
  527. where "<b><em>Name</em></b>" is no more than eight characters.
  528. <p>
  529. Begin the new file name with an upper-case letter like the existing names,
  530. which are in mixed case beginning with upper-case letters. Use spelling,
  531. not case, to distinguish between names: that is, don't create a new file
  532. whose name differs from an existing one only by the difference between
  533. upper and lower case, because some platforms can't store two such files.
  534. <h3><a name="Plagiarize"></a>Use an existing document as a model</h3>
  535. <p>
  536. To create an entirely new Ghostscript document, plagiarize this one for the
  537. <a href="#Structuring_comments">structuring comments</a> and other useful
  538. parts. Then, using the <a href="#Structuring_comments">structuring
  539. comments</a> as a guide to the sections of the document (in a text editor,
  540. search for "<b><tt>&lt;!--&nbsp;[</tt></b>"):
  541. <ul>
  542. <li>insert your own HTML title and <a href="#Headline">headline</a> (they
  543. should ordinarily be the same text) in place of the old ones;
  544. <li>insert your own RCS <b><tt>$Id</tt></b> in place of the old one in the
  545. <a href="#Structure_head">HTML header</a>;
  546. <li>delete the old entries in the <a href="#Table_of_contents">table of
  547. contents</a>;
  548. <li>keep the hint paragraph;
  549. <li>delete the entire contents section between the structuring comments;
  550. and
  551. <li>in the trailer, update the version number and date.
  552. </ul>
  553. <p>
  554. You now have a template document ready for new contents.
  555. <h3><a name="Readme_material"></a>Write new references to go in <b><tt>Readme.htm</tt></b></h3>
  556. <p>
  557. Write material to go in <a href="Readme.htm"><b><tt>Readme.htm</tt></b></a>
  558. that describes the new document, and links to it from two sections:
  559. <ul>
  560. <li>the <a href="Readme.htm#Theme_roadmap">thematic section</a> and
  561. <li>the descriptions of documentation
  562. <a href="Readme.htm#Ordered_roadmap">arranged by file name</a>.
  563. </ul>
  564. <h3><a name="New_doc_other"></a>Other considerations</h3>
  565. <p>
  566. Follow the other guidelines here, including which elements of the
  567. document should go in which section according to the structuring comments,
  568. and <a href="#Headers">anchoring every <b><tt>&lt;Hn&gt;</tt></b>
  569. header</a>. As you create text and headers, you will want to rebuild the
  570. <a href="#Table_of_contents">table of contents</a> from the headers
  571. occasionally.
  572. <p>
  573. Pete Kaiser &lt;<a href="mailto:kaiser@acm.org">kaiser@acm.org</a>&gt;
  574. wrote a package of GNU emacs functions specifically to handle Ghostscript
  575. HTML documentation, including functions to build a table of contents from
  576. headers in an HTML document, and to build and maintain tables and
  577. other structures built along the guidelines in this document.
  578. <hr>
  579. <h2><a name="Miscellany"></a>Miscellany</h2>
  580. <p>
  581. Use <b><tt>&lt;&gt;</tt></b> to bracket links to visible email addresses
  582. (<b><tt>mailto</tt></b>) in running text. This makes it easy for a user to
  583. cut and paste the entire name and address into another document or mailer,
  584. for instance
  585. <blockquote>
  586. Free Software Foundation &lt;<a href="mailto:gnu@gnu.org">gnu@gnu.org</a>&gt;
  587. </blockquote>
  588. <p>
  589. For exponentiation use "<b><tt>^</tt></b>" (not "**" or "exp()") plus
  590. writing the exponent as a superscript in <b><tt>&lt;small&gt;</tt></b>
  591. size:
  592. <blockquote>
  593. Something<b><tt>^&lt;sup&gt;</tt></b><b><tt>&lt;small&gt;</tt></b>exponent<b><tt>&lt;/small&gt;&lt;/sup&gt;</tt></b>.
  594. </blockquote>
  595. <p>
  596. to look like this:
  597. <blockquote>
  598. Something<b><tt>^</tt></b><sup><small>exponent</small></sup>
  599. </blockquote>
  600. <p>
  601. This is intended for readability both in a browser and as plain text.
  602. <!-- [2.0 end contents] ==================================================== -->
  603. <!-- [3.0 begin visible trailer] =========================================== -->
  604. <hr>
  605. <p>
  606. <small>Copyright &copy; 1996, 2000 Aladdin Enterprises. All rights
  607. reserved.</small>
  608. <p>
  609. <small>This file is part of AFPL Ghostscript. See the
  610. <a href="Public.htm">Aladdin Free Public License</a> (the "License") for
  611. full details of the terms of using, copying, modifying, and redistributing
  612. AFPL Ghostscript.</small>
  613. <p>
  614. <small>Ghostscript version 7.04, 31 January 2002
  615. <!-- [3.0 end visible trailer] ============================================= -->
  616. </body>
  617. </html>