5 How to Create a Document Once you have used NCSA Mosaic for a time, you may want to create your own documents and make them available to the Web. If you have used a markup language previously (such as TeX, LaTeX, or troff) you will make the transition to the HTML markup language readily. This chapter is a brief introduction to HTML and document construction. An online reference guide is available from the Help menu. HTTPÑthe Server You might want to set up a Web server to give the Web com- munity access to your information. The standard transfer protocol used by Web servers is called the HyperText Trans- fer Protocol (HTTP). See ÒSystem Configuration and Modifica- tion AssistanceÓ on pageÊCÐ1 for more information. (You can also serve HTML documents from a Gopher or anonymous FTP server.) NCSA has developed server software for UNIX platforms that is available on the NCSA anonymous FTP server (see ÒNCSA Server AddressesÓ on pageÊCÐ2). HTTP server software is cur- rently available from other Web sources for UNIX, Macintosh, and Microsoft Windows platforms. HyperText Markup Language To create a hypermedia document for display on a Web server, you need to learn the HyperText Markup Language (HTML), which is a collection of styles that define the various components of a document. HTML is based on SGML (Stan- dardized General Markup Language). NCSA Mosaic can display ASCII text files. This is another way of saying that you do not have to learn HTML to have docu- ments available on a Web server. However, if you want to have a document formatted when accessed by a viewer such as NCSA Mosaic, you must code it with HTML. The coded file creates what you see formatted in the Docu- ment View window. To view the coded file, select View Source from the File menu. In the resulting Document Source window (see Figure 5.1) is an HTML-coded file. (This is usually but not always true; you could be viewing a straight ASCII text docu- ment.) Save your coded file with the .html extention (e.g., myfile.html). Figure 5.1 Document Source Window Some Basics HTML-coded documents are called source files. Source files are in plain text format and can be created using any text edi- tor (e.g., EMACS or vi on UNIX workstations). Several Web browsers (tkWWW for X Window System machines and CERNÕs Web browser for the NeXT) include rudimentary HTML editors in a WYSIWYG (what you see is what you get) environment, and you may want to try one of them. See ÒWeb ResourcesÓ on pageÊCÐ1 for more on HTML editors. HTML tags consist of a left angle bracket (<), followed by some coding (called the directive), and closed by a right angle bracket (>). HTML tags are generally paired (e.g.,

and . The ending tag looks just like the starting tag except a slash (/) precedes the directive within the brackets. For exam- ple,

tells the viewer to start formatting a top-level head- ing, and

tells the viewer that the heading is complete. HTML tags are inserted in the source files to tell NCSA Mosaic (or some other Web viewer) how to interpret or display the coded information. For example, citation tags are defined by NCSA Mosaic to be displayed in italics. Each time you enclose a book title between and tags, NCSA Mosaic automatically displays the text in italics. This is known as a logical style, because it is configured by the viewer. Viewers can interpret a logical style in different ways. Hyperlinks The chief power of HTML comes from its ability to link regions of text (and also images) to another document (or an image, movie, or audio file). These regions are highlighted to indicate that they are hypertext links. To create a hyperlink, a special HTML code is entered that includes the URL (see ÒThe URL FormatÓ on page 3-4). At the same time, text or a graphic is designated to serve as the anchor (the information that is displayed in color or underlined and clicked on). A hyperlink may be made to a remote or local server. Images NCSA Mosaic can display images inside documents, making it a highly visual medium for your information. However, each image requires processing time, which slows down the initial display of the document. Using a particular image multiple times in a document causes very little performance degrada- tion compared to using the image only once. An image is sized before it is included in a document. Images can fill a screen or they can be Òpostage stampsÓÑsmall images that save time when NCSA Mosaic displays the docu- ment but are still large enough to present information and be a teaser for the larger image displayed in a separate win- dow. An image tag is coded into the source file to tell NCSA Mosaic that an image is to be displayed. The image tag is an HTML extension first implemented in NCSA Mosaic. Online Help The BeginnerÕs Guide to HTML, which explains creating and coding HTML files and lists common HTML codes, is located under On HTML... on the Help menu. Refer to this document for more detailed information on making hyperlinks and includ- ing images in your documents. The BeginnerÕs Guide may be printed for easy reference by selecting Print... from the File menu.