Thomas Lockhart Tom Ivar Helbekkmo 1998-04-28 Documentation The purpose of documentation is to make Postgres easier to learn, use, and develop. The documentation set should describe the Postgres system, language, and interfaces. It should be able to answer common questions and to allow a user to find those answers on his own without resorting to mailing list support. Postgres has four primary documentation formats: Plain text for pre-installation information. HTML, for on-line browsing and reference. Hardcopy, for in-depth reading and reference. man pages, for quick reference. Documentation sources include plain text files, man pages, and html. However, most new Postgres documentation will be written using the Standard Generalized Markup Language (SGML) DocBook Document Type Definition (DTD). Much of the existing documentation has been or will be converted to SGML. Documentation Roadmap Documentation has accumulated from several sources. As we integrate and assimilate existing documentation into a coherent documentation set, the older versions will become obsolete and will be removed from the distribution. However, this will not happen immediately, and will not happen to all documents at the same time. To ease the transition, and to help guide developers and writers, we have defined a transition roadmap. Here is the documentation plan for v6.4: Convert Jose Soares Da Silva's text-based reference pages to SGML reference sections for the User's Guide. Oliver Elphick is working on this and it is roughly half-way completed. Write more sections for the User's Guide covering areas outside the reference pages. This would include introductory information and suggestions for approaches to typical design problems. Merge information in the existing man pages into the reference pages and User's Guide. Convert the new sgml reference pages to new man pages, replacing the existing man pages. Brandon Ibach is working on the conversion filter. Rebuild the User's Guide, Reference Guide, and Administrator's Guide (the admin guide only if we get release notes and installation information updated in SGML). <ProductName>Postgres</ProductName> Documentation Products File Description ./COPYRIGHT Copyright notice ./register.txt Registration message during make ./doc/bug.template Not converted ./doc/postgres.tar.gz Integrated docs (HTML) ./doc/programmer.ps.gz Programmer's Guide (Postscript) ./doc/programmer.tar.gz Programmer's Guide (HTML) ./doc/reference.ps.gz Reference Manual (Postscript) ./doc/reference.tar.gz Reference Manual (HTML) ./doc/tutorial.ps.gz Introduction (Postscript) ./doc/tutorial.tar.gz Introduction (HTML) ./doc/user.ps.gz User's Guide (Postscript) ./doc/user.tar.gz User's Guide (HTML)
Documentation Sources <ProductName>Postgres</ProductName> Documentation Sources File Status ./doc/src/graphics/catalogs.gif Output file ./doc/src/graphics/clientserver.ag Source file. Convert to CGM ./doc/src/graphics/clientserver.gif Output file ./doc/src/graphics/connections.ag Source file. Convert to CGM ./doc/src/graphics/connections.gif Output file ./doc/src/graphics/layout.ag Source file. Convert to CGM ./doc/src/graphics/layout.gif Output file ./doc/src/sgml/spi.sgml Converted. Original removed. ./doc/src/sgml/admin.sgml Converted ./doc/src/sgml/advanced.sgml Converted ./doc/src/sgml/arch-dev.sgml Converted ./doc/src/sgml/arch-pg.sgml Converted ./doc/src/sgml/arch.sgml Converted ./doc/src/sgml/array.sgml Converted ./doc/src/sgml/biblio.sgml Converted ./doc/src/sgml/compiler.sgml Converted ./doc/src/sgml/contacts.sgml Sample. Either complete or discard ./doc/src/sgml/datatype.sgml New document. Replaces man/pgbuiltin.3 ./doc/src/sgml/dfunc.sgml Converted ./doc/src/sgml/docguide.sgml New document. ./doc/src/sgml/ecpg.sgml Converted ./doc/src/sgml/environ.sgml Converted ./doc/src/sgml/extend.sgml Converted ./doc/src/sgml/func-ref.sgml Converted ./doc/src/sgml/func.sgml Converted ./doc/src/sgml/geqo.sgml Converted. Original removed. ./doc/src/sgml/gist.sgml New from mailing list ./doc/src/sgml/inherit.sgml Converted ./doc/src/sgml/install.sgml Converted ./doc/src/sgml/intro-pg.sgml Converted ./doc/src/sgml/intro.sgml Converted ./doc/src/sgml/jdbc.sgml Converted ./doc/src/sgml/libpgtcl.sgml Converted ./doc/src/sgml/libpq.sgml Converted ./doc/src/sgml/lobj.sgml Converted ./doc/src/sgml/manage.sgml Converted ./doc/src/sgml/odbc.sgml Converted ./doc/src/sgml/oper.sgml Converted ./doc/src/sgml/pgaccess.sgml Converted ./doc/src/sgml/ports.sgml Converted ./doc/src/sgml/postgres.sgml Converted ./doc/src/sgml/programmer.sgml Converted ./doc/src/sgml/protocol.sgml Converted ./doc/src/sgml/psql.sgml Converted ./doc/src/sgml/query-ug.sgml Converted ./doc/src/sgml/query.sgml Converted ./doc/src/sgml/recovery.sgml Converted ./doc/src/sgml/reference.sgml Converted ./doc/src/sgml/regress.sgml Converted ./doc/src/sgml/release.sgml Converted ./doc/src/sgml/rules.sgml Converted ./doc/src/sgml/start-ag.sgml Converted ./doc/src/sgml/start.sgml Converted ./doc/src/sgml/storage.sgml Converted ./doc/src/sgml/trigger.sgml Converted ./doc/src/sgml/tutorial.sgml Converted ./doc/src/sgml/typeconv.sgml New document ./doc/src/sgml/user.sgml Converted ./doc/src/sgml/xaggr.sgml Converted ./doc/src/sgml/xfunc.sgml Converted ./doc/src/sgml/xindex.sgml Converted ./doc/src/sgml/xoper.sgml Converted ./doc/src/sgml/xtypes.sgml Converted ./doc/src/sgml/ref/allfiles.sgml List of files in ref/ (internal) ./doc/src/sgml/ref/alter_table.sgml New ./doc/src/sgml/ref/alter_user.sgml New ./doc/src/sgml/ref/begin.sgml New ./doc/src/sgml/ref/close.sgml New ./doc/src/sgml/ref/cluster.sgml New ./doc/src/sgml/ref/commands.sgml List of commands (internal) ./doc/src/sgml/ref/commit.sgml New ./doc/src/sgml/ref/copy.sgml New ./doc/src/sgml/ref/create_aggregate.sgml New ./doc/src/sgml/ref/create_database.sgml New ./doc/src/sgml/ref/create_function.sgml New ./doc/src/sgml/ref/create_index.sgml New ./doc/src/sgml/ref/create_language.sgml New ./doc/src/sgml/ref/drop_function.sgml New ./doc/src/sgml/ref/select.sgml New ./doc/src/sgml/ref/create_operator.sgml New ./doc/src/sgml/ref/create_rule.sgml New ./doc/src/sgml/ref/create_sequence.sgml New ./doc/src/sgml/ref/create_table.sgml New
Document Conversion Status <ProductName>Postgres</ProductName> Documentation Sources File Status ./HISTORY Obsolete. Converted to release.sgml ./README Not converted ./INSTALL Obsolete. Converted to install.sgml ./contrib/README Not converted ./contrib/apache_logging/README Not converted ./contrib/array/array_iterator.doc Not converted ./contrib/datetime/datetime_functions.doc Not converted ./contrib/earthdistance/README Not converted ./contrib/int8/README Not converted ./contrib/ip_and_mac/README Not converted ./contrib/lo/README Not converted ./contrib/mSQL-interface/README Not converted ./contrib/noupdate/noup.example Not converted ./contrib/pginterface/README Not converted ./contrib/sequence/set_sequence.sql.in Not converted ./contrib/soundex/soundex.sql.in Not converted ./contrib/spi/README Not converted ./contrib/spi/autoinc.example Not converted ./contrib/spi/insert_username.example Not converted ./contrib/spi/refint.example Not converted ./contrib/spi/timetravel.example Not converted ./contrib/string/string_io.sql.in Not converted ./contrib/unixdate/unixdate.sql Not converted ./contrib/userlock/user_locks.doc Not converted ./doc/FAQ Not converted ./doc/FAQ_DEV Not converted ./doc/FAQ_FreeBSD Not converted ./doc/FAQ_Irix Not converted ./doc/FAQ_Linux Not converted ./doc/TODO Not converted ./doc/README.GEQO Removed. Superceded by geqo.sgml ./doc/README.fsync Assimilate into Admin Guide ./doc/README.locale Assimilate into Admin Guide ./doc/README.mb Assimilate into Admin Guide ./doc/README.mb.jp Not converted ./doc/README.support Not converted ./doc/TODO.GEQO Removed. Superceded by geqo.sgml ./doc/userguide.ps Removed (converted to SGML) ./migration/1.02_to_1.02.1 Removed. Superceded by release.sgml ./migration/1.09_to_6.0 Removed. Superceded by release.sgml ./migration/1.0_to_1.01 Removed. Superceded by release.sgml ./migration/6.0_to_6.1 Removed. Superceded by release.sgml ./migration/6.1_to_6.1.1 Removed. Superceded by release.sgml ./migration/6.1_to_6.2 Removed. Superceded by release.sgml ./migration/6.2.1_to_6.3 Removed. Superceded by release.sgml ./migration/6.2_to_6.2.1 Removed. Superceded by release.sgml ./migration/6.3.1_to_6.3.2 Removed. Superceded by release.sgml ./src/DEVELOPERS Not converted ./src/backend/access/nbtree/README Not converted ./src/backend/catalog/README Not converted ./src/backend/libpq/pg_hba.conf.sample Not converted ./src/backend/libpq/pg_ident.conf.sample Not converted ./src/backend/nodes/README Not converted ./src/backend/optimizer/README Not converted ./src/backend/optimizer/geqo/pg_geqo.sample Not converted ./src/backend/optimizer/plan/README Not converted ./src/backend/parser/README Not converted ./src/backend/port/dynloader/README.dlfcn.aix Not converted ./src/backend/regex/COPYRIGHT Not converted ./src/backend/regex/WHATSNEW Not converted ./src/backend/regex/re_format.7 Not converted ./src/backend/regex/regex.3 Not converted ./src/backend/storage/ipc/README Not converted ./src/backend/storage/lmgr/README Not converted ./src/backend/storage/smgr/README Not converted ./src/bin/pg_dump/README Not converted ./src/bin/pgaccess/README.pga Not converted ./src/bin/pgaccess/formdemo.sql Not converted ./src/bin/pgtclsh/README Not converted ./src/data/charset.conf Not converted ./src/data/koi-alt.tab Not converted ./src/data/koi-iso.tab Not converted ./src/data/koi-koi.tab Not converted ./src/data/koi-mac.tab Not converted ./src/data/koi-win.tab Not converted ./src/interfaces/ecpg/ChangeLog Not converted ./src/interfaces/ecpg/TODO Not converted ./src/interfaces/jdbc/README Not converted ./src/interfaces/jdbc/README_6.3 Not converted ./src/interfaces/jdbc/example/ImageViewer.java Not converted ./src/interfaces/jdbc/example/basic.java Not converted ./src/interfaces/jdbc/example/blobtest.java Not converted ./src/interfaces/jdbc/example/datestyle.java Not converted ./src/interfaces/jdbc/example/psql.java Not converted ./src/interfaces/libpgtcl/README Not converted ./src/interfaces/libpq/README Not converted ./src/interfaces/libpq++/README Not converted ./src/interfaces/libpq++/examples/testlibpq0.cc Not converted ./src/interfaces/libpq++/examples/testlibpq1.cc Not converted ./src/interfaces/libpq++/examples/testlibpq2.cc Not converted ./src/interfaces/libpq++/examples/testlibpq2.sql Not converted ./src/interfaces/libpq++/examples/testlibpq3.cc Not converted ./src/interfaces/libpq++/examples/testlibpq3.sql Not converted ./src/interfaces/libpq++/examples/testlibpq4.cc Not converted ./src/interfaces/libpq++/examples/testlibpq4.sql Not converted ./src/interfaces/libpq++/examples/testlibpq5.cc Not converted ./src/interfaces/libpq++/examples/testlibpq5.sql Not converted ./src/interfaces/libpq++/examples/testlibpq6.cc Not converted ./src/interfaces/libpq++/examples/testlo.cc Not converted ./src/interfaces/libpq++/man/libpq++.3 Not converted ./src/interfaces/odbc/license.txt Not converted ./src/interfaces/odbc/notice.txt Not converted ./src/interfaces/odbc/readme.txt Not converted ./src/interfaces/perl5/MANIFEST Not converted ./src/interfaces/perl5/Changes Not converted ./src/interfaces/perl5/eg/example.newstyle Not converted ./src/interfaces/perl5/README Not converted ./src/interfaces/python/Announce Not converted ./src/interfaces/python/ChangeLog Not converted ./src/interfaces/python/README Not converted ./src/interfaces/python/tutorial/advanced.py Not converted ./src/interfaces/python/tutorial/advanced.pyc Not converted ./src/interfaces/python/tutorial/basics.py Not converted ./src/interfaces/python/tutorial/func.py Not converted ./src/interfaces/python/tutorial/func.pyc Not converted ./src/interfaces/python/tutorial/pgtools.py Not converted ./src/interfaces/python/tutorial/pgtools.pyc Not converted ./src/interfaces/python/tutorial/syscat.py Not converted ./src/interfaces/python/tutorial/syscat.pyc Not converted ./src/man/README Not converted ./src/man/ecpg.1 Not converted ./src/man/abort.l Not converted ./src/man/alter_table.l Not converted ./src/man/alter_user.l Split into Reference and Admin Guide ./src/man/begin.l Not converted ./src/man/bki.5 Removed. Superceded by bki.sgml ./src/man/catalogs.3 Catalog synopsis. Move to Programmer's Guide? ./src/man/cleardbdir.1 Not converted ./src/man/close.l Not converted ./src/man/cluster.l Not converted ./src/man/commit.l Not converted ./src/man/copy.l Not converted ./src/man/create_aggregate.l Not converted ./src/man/create_database.l Not converted ./src/man/create_function.l Not converted ./src/man/create_index.l Not converted ./src/man/create_language.l Not converted ./src/man/create_operator.l Not converted ./src/man/create_rule.l Not converted ./src/man/create_sequence.l Not converted ./src/man/create_table.l Not converted ./src/man/create_trigger.l Not converted ./src/man/create_type.l Not converted ./src/man/create_user.l Not converted ./src/man/create_version.l Not converted ./src/man/create_view.l Not converted ./src/man/createdb.1 Not converted ./src/man/createuser.1 Not converted ./src/man/declare.l Not converted ./src/man/delete.l Not converted ./src/man/destroydb.1 Not converted ./src/man/destroyuser.1 Not converted ./src/man/drop.l Not converted ./src/man/drop_aggregate.l Not converted ./src/man/drop_database.l Not converted ./src/man/drop_function.l Not converted ./src/man/drop_index.l Not converted ./src/man/drop_language.l Not converted ./src/man/drop_operator.l Not converted ./src/man/drop_rule.l Not converted ./src/man/drop_sequence.l Not converted ./src/man/drop_table.l Not converted ./src/man/drop_trigger.l Not converted ./src/man/drop_type.l Not converted ./src/man/drop_user.l Not converted ./src/man/drop_view.l Not converted ./src/man/end.l Not converted ./src/man/explain.l Not converted ./src/man/fetch.l Not converted ./src/man/grant.l Not converted ./src/man/initdb.1 Not converted ./src/man/initlocation.1 Not converted ./src/man/insert.l Not converted ./src/man/ipcclean.1 Not converted ./src/man/large_objects.3 Not converted ./src/man/libpq.3 Obsolete. Superceded by libpq.sgml ./src/man/listen.l Not converted ./src/man/load.l Not converted ./src/man/lock.l Not converted ./src/man/move.l Not converted ./src/man/notify.l Not converted ./src/man/oracle_compat.3 Removed. Superceded by func.sgml ./src/man/page.5 Table storage. Assimilate into Dev Guide ./src/man/pg_dump.1 Assimilate into Admin Guide ./src/man/pg_dumpall.1 Assimilate into Admin Guide ./src/man/pg_hba.conf.5 Assimilate into Admin Guide ./src/man/pg_passwd.1 Assimilate into Admin Guide ./src/man/pgbuiltin.3 Obsolete. Superceded by datatype.sgml ./src/man/pgintro.1 Assimilate into User's Guide? ./src/man/postgres.1 Assimilate into User's, Admin Guides ./src/man/postmaster.1 Assimilate into User's, Admin Guides ./src/man/psql.1 Not converted ./src/man/reset.l Not converted ./src/man/revoke.l Not converted ./src/man/rollback.l Not converted ./src/man/select.l Not converted ./src/man/set.l Not converted ./src/man/show.l Not converted ./src/man/sql.l Not converted ./src/man/update.l Not converted ./src/man/vacuum.l Not converted ./src/pl/tcl/INSTALL Not converted ./src/pl/tcl/modules/README Not converted ./src/pl/tcl/license.terms Not converted ./src/pl/tcl/test/README Not converted ./src/pl/tcl/test/runtest Not converted ./src/pl/tcl/test/test.expected Not converted ./src/pl/tcl/test/test_mklang.sql Not converted ./src/pl/tcl/test/test_queries.sql Not converted ./src/pl/tcl/test/test_setup.sql Not converted ./src/test/bench/WISC-README Not converted ./src/test/locale/README Not converted ./src/test/performance/results/PgSQL.970926 Not converted ./src/test/regress/README Not converted ./src/test/suite/README Not converted ./src/tools/RELEASE_CHANGES Not converted ./src/tools/SQL_keywords Not converted ./src/tools/backend/README Not converted ./src/tools/backend/flow.fig Not converted ./src/tools/backend/flow.jpg Not converted ./src/tools/make_keywords.README Not converted ./src/tools/entab/entab.man Not converted ./src/tools/make_diff/README Not converted ./src/tools/mkldexport/README Not converted ./src/tools/pgindent/README Not converted ./src/tutorial/README Not converted ./src/utils/README Not converted ./lib/pg_hba.conf.sample Not converted ./lib/pg_geqo.sample Not converted
Document Structure There are currently five separate documents written in DocBook. Each document has a container source document which defines the DocBook environment and other document source files. These primary source files are located in doc/src/sgml/, along with many of the other source files used for the documentation. The primary source files are: postgres.sgml This is the integrated document, including all other documents as parts. Output is generated in HTML since the browser interface makes it easy to move around all of the documentation by just clicking. The other documents are available in both HTML and hardcopy. tutorial.sgml The introductory tutorial, with examples. Does not include programming topics, and is intended to help a reader unfamiliar with SQL. This is the "getting started" document. user.sgml The User's Guide. Includes information on data types and user-level interfaces. This is the place to put information on "why". reference.sgml The Reference Manual. Includes Postgres SQL syntax. This is the place to put information on "how". programming.sgml The Programmer's Guide. Includes information on Postgres extensibility and on the programming interfaces. admin.sgml The Administrator's Guide. Include installation and release notes. Introduction Packaged documentation is available in both HTML and Postscript formats. These are available as part of the standard Postgres installation. We discuss here working with the documentation sources and generating documentation packages. This is the first release of new Postgres documentation in three years. The content and environment are in flux and still evolving. The purpose of SGML is to allow an author to specify the structure and content of a document (e.g. using the DocBook DTD), and to have the document style define how that content is rendered into a final form (e.g. using Norm Walsh's stylesheets). See Introduction to DocBook for a nice "quickstart" summary of DocBook features. DocBook Elements provides a powerful cross-reference for features of DocBook. This documentation set is constructed using several tools, including James Clark's jade and Norm Walsh's Modular DocBook Stylesheets. Currently, hardcopy is produced by importing Rich Text Format (RTF) output from jade into ApplixWare for minor formatting fixups then exporting as a Postscript file. TeX is a supported format for jade output, but was not used at this time for several reasons, including the inability to make minor format fixes before committing to hardcopy and generally inadequate table support in the TeX stylesheets. Styles and Conventions DocBook has a rich set of tags and constructs, and a suprisingly large percentage are directly and obviously useful for well-formed documentation. The Postgres documentation set has only recently been adapted to SGML, and in the near future several sections of the set will be selected and maintained as prototypical examples of DocBook usage. Also, a short summary of DocBook tags will be included below. Document Writing Document Structure There are currently five separate documents written in DocBook. Each document has a container source document which defines the DocBook environment and other document source files. These primary source files are located in doc/src/sgml/, along with many of the other source files used for the documentation. The primary source files are: postgres.sgml This is the integrated document, including all other documents. tutorial.sgml The introductory tutorial, with examples. Does not include programming topics, and is intended to help get someone unfamiliar with SQL started. user.sgml The User's Guide. Includes information on data types and user-level interfaces. This is the place to put information on "why". reference.sgml The Reference Manual. Includes Postgres SQL syntax. programming.sgml The Programmer's Guide. Includes information on Postgres extensibility and on the programming interfaces. admin.sgml The Administrator's Guide. Include installation and release notes. Authoring Tools The current Postgres documentation set is written using a plain text editor (or emacs/psgml; see below) with the content marked up using SGML. SGML and DocBook do not suffer from an oversupply of open-source authoring tools. The most common toolset is the emacs/xemacs editing package with the psgml feature extension. On some systems (e.g. RedHat Linux) these tools are provided in a typical full installation. emacs/psgml When using emacs/psgml, a comfortable way of working with these separate files of book parts is to insert a proper DOCTYPE declaration while you're editing them. If you are working on this source, for instance, it's an appendix chapter, so you would specify the document as an "appendix" instance of a DocBook document by making the first line look like this: !doctype appendix PUBLIC "-//Davenport//DTD DocBook V3.0//EN" This means that anything and everything that reads SGML will get it right, and I can verify the document with "nsgmls -s docguide.sgml". Building Documentation GNU make is used to build documentation from the DocBook sources. There are a few environment definitions which may need to be set or modified for your installation. The Makefile looks for doc/../src/Makefile and (implicitly) for doc/../src/Makefile.custom to obtain environment information. On my system, the src/Makefile.custom looks like # Makefile.custom # Thomas Lockhart 1998-03-01 POSTGRESDIR= /opt/postgres/current CFLAGS+= -m486 YFLAGS+= -v # documentation HSTYLE= /home/tgl/SGML/db107.d/docbook/html PSTYLE= /home/tgl/SGML/db107.d/docbook/print where HSTYLE and PSTYLE determine the path to docbook.dsl for HTML and hardcopy (print) stylesheets, respectively. These stylesheet file names are for Norm Walsh's Modular Style Sheets; if other stylesheets are used then one can define HDSL and PDSL as the full path and file name for the stylesheet, as is done above for HSTYLE and PSTYLE. On many systems, these stylesheets will be found in packages installed in /usr/lib/sgml/, /usr/share/lib/sgml/, or /usr/local/lib/sgml/. HTML documentation packages can be generated from the SGML source by typing % cd doc/src % make tutorial.tar.gz % make user.tar.gz % make admin.tar.gz % make programmer.tar.gz % make postgres.tar.gz % make install These packages can be installed from the main documentation directory by typing % cd doc % make install Hardcopy Generation for v6.3 The hardcopy Postscript documentation is generated by converting the SGML source code to RTF, then importing into Applixware. After a little cleanup (see the following section) the output is "printed" to a postscript file. Some figures were redrawn to avoid having bitmap GIF files in the hardcopy documentation. One figure, of the system catalogs, was sufficiently complex that there was not time to redraw it. It was converted to fit using the following commands: % convert -v -geometry 400x400'>' figure03.gif con.gif % convert -v -crop 400x380 con.gif connections.gif <acronym>RTF</acronym> Cleanup Procedure Several items must be addressed in generating Postscript hardcopy: Applixware <acronym>RTF</acronym> Cleanup Applixware does not seem to do a complete job of importing RTF generated by jade/MSS. In particular, all text is given the Header1 style attribute label, although the text formatting itself is acceptable. Also, the Table of Contents page numbers do not refer to the section listed in the table, but rather refer to the page of the ToC itself. Generate the RTF input by typing % cd doc/src/sgml % make tutorial.rtf Open a new document in Applix Words and then import the RTF file. Print out the existing Table of Contents, to mark up in the following few steps. Insert figures into the document. Center each figure on the page using the centering margins button. Not all documents have figures. You can grep the SGML source files for the string Graphic to identify those parts of the documentation which may have figures. A few figures are replicated in various parts of the documentation. Work through the document, adjusting page breaks and table column widths. If a bibliography is present, Applix Words seems to mark all remaining text after the first title as having an underlined attribute. Select all remaining text, turn off underlining using the underlining button, then explicitly underline each document and book title. Work through the document, marking up the ToC hardcopy with the actual page number of each ToC entry. Replace the right-justified incorrect page numbers in the ToC with correct values. This only takes a few minutes per document. Save the document as native Applix Words format to allow easier last minute editing later. Export the document to a file in Postscript format. Compress the Postscript file using gzip. Place the compressed file into the doc directory. Toolsets We have documented experience with two installation methods for the various tools that are needed to process the documentation. One is installation from RPMs on Linux, the other is a general installation from original distributions of the individual tools. Both will be described below. We understand that there are some other packaged distributions for these tools. FreeBSD seems to have them available. Please report package status to the docs mailing list and we will include that information here. <acronym>RPM</acronym> installation on <productname>Linux</productname> Install RPMs for Jade and related packages. Manual installation of tools This is a brief run-through of the process of obtaining and installing the software you'll need to edit DocBook source with Emacs and process it with Norman Walsh's DSSSL style sheets to create HTML and RTF. Prerequisites What you need: A working installation of GCC 2.7.2 A working installation of Emacs 19.19 or later An unzip program for UNIX to unpack things What you must fetch: James Clark's Jade version 1.1 DocBook version 3.0 Norman Walsh's Modular Stylesheets version 1.07 Lennart Staflin's PSGML version 1.0.1 Important URLs: The Jade web page The DocBook web page The Modular Stylesheets web page The PSGML web page Steve Pepper's Whirlwind Guide Robin Cover's database of SGML software Installing Jade First, read the installation instructions at the above listed URL. Unzip the distribution kit in a suitable place. The command to do this will be something like unzip -aU jade1_1.zip Jade is not built using GNU Autoconf, so you'll need to edit a Makefile yourself. Since James Clark has been good enough to prepare his kit for it, it is a good idea to make a build directory (named for your machine architecture, perhaps) under the main directory of the Jade distribution, copy the file Makefile from the main directory into it, edit it there, and then run make there. However, the Makefile does need to be edited. There is a file called Makefile.jade in the main directory, which is intended to be used with make -f Makefile.jade when building Jade (as opposed to just SP, the SGML parser kit that Jade is built upon). We suggest that you don't do that, though, since there is more that you need to change than what is in Makefile.jade, so you'd have to edit one of them anyway. Go through the Makefile, reading James' instructions and editing as needed. There are various variables that need to be set. Here is a collected summary of the most important ones, with typical values: prefix = /usr/local XDEFINES = -DSGML_CATALOG_FILES_DEFAULT=\"/usr/local/share/sgml/catalog\" XLIBS = -lm RANLIB = ranlib srcdir = .. XLIBDIRS = grove spgrove style XPROGDIRS = jade Note the specification of where to find the default catalog of SGML support files -- you may want to change that to something more suitable for your own installation. If your system doesn't need the above settings for the math library and the ranlib command, leave them as they are in the Makefile. Now type make to build Jade and the various SP tools. Once the software is built, make install will do the obvious. Installing the <productname>DocBook</productname> <acronym>DTD</acronym> kit You'll want to place the files that make up the DocBook DTD kit in the directory you built Jade to expect them in, which, if you followed our suggestion above, is /usr/local/share/sgml/. In addition to the actual DocBook files, you'll need to have a catalog file in place, for the mapping of document type specifications and external entity references to actual files in that directory. You'll also want the ISO character set mappings, and probably one or more versions of HTML. One way to install the various DTD and support files and set up the catalog file, is to collect them all into the above mentioned directory, use a single file named CATALOG to describe them all, and then create the file catalog as a catalog pointer to the former, by giving it the single line of content: CATALOG /usr/local/share/sgml/CATALOG The CATALOG file should then contain three types of lines. The first is the (optional) SGML declaration, thus: SGMLDECL docbook.dcl Next, the various references to DTD and entity files must be resolved. For the DocBook files, these lines look like this: PUBLIC "-//Davenport//DTD DocBook V3.0//EN" docbook.dtd PUBLIC "-//USA-DOD//DTD Table Model 951010//EN" cals-tbl.dtd PUBLIC "-//Davenport//ELEMENTS DocBook Information Pool V3.0//EN" dbpool.mod PUBLIC "-//Davenport//ELEMENTS DocBook Document Hierarchy V3.0//EN" dbhier.mod PUBLIC "-//Davenport//ENTITIES DocBook Additional General Entities V3.0//EN" dbgenent.mod Of course, a file containing these comes with the DocBook kit. Note that the last item on each of these lines is a file name, given here without a path. You can put the files in subdirectories of your main SGML directory if you like, of course, and modify the reference in the CATALOG file. DocBook also references the ISO character set entities, so you need to fetch and install these (they are available from several sources, and are easily found by way of the URLs listed above), along with catalog entries for all of them, such as: PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN" ISO/ISOlat1 Note how the file name here contains a directory name, showing that we've placed the ISO entity files in a subdirectory named ISO. Again, proper catalog entries should accompany the entity kit you fetch. Installing Norman Walsh's <acronym>DSSSL</acronym> style sheets First, read the installation instructions at the above listed URL. To install Norman's style sheets, simply unzip the distribution kit in a suitable place. A good place to dot this would be /usr/local/share, which places the kit in a directory tree under /usr/local/share/docbook. The command will be something like unzip -aU db107.zip One way to test the installation is to build the HTML and RTF forms of the PostgreSQL manual. Go to the SGML source directory, doc/src/sgml, and say jade -t sgml -d /usr/local/share/docbook/html/docbook.dsl -D ../graphics postgres.sgml to build the HTML files ("book1.htm" is the top level node), and jade -t rtf -d /usr/local/share/docbook/print/docbook.dsl -D ../graphics postgres.sgml to generate the RTF output, ready for importing into your favorite word processing system and printing. Installing <productname>PSGML</productname> First, read the installation instructions at the above listed URL. Unpack the distribution file, run configure, make and make install to put the byte-compiled files and info library in place. Then add the following lines to your /usr/local/share/emacs/site-lisp/site-start.el file to make Emacs properly load PSGML when needed: (setq load-path (cons "/usr/local/share/emacs/site-lisp/psgml" load-path)) (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) If you want to use PSGML when editing HTML too, also add this: (setq auto-mode-alist (cons '("\\.s?html?\\'" . sgml-mode) auto-mode-alist)) There is one important thing to note with PSGML: its author assumed that your main SGML DTD directory would be /usr/local/lib/sgml. If, as in the examples in this chapter, you use /usr/local/share/sgml, you have to compensate for this. You can set the SGML_CATALOG_FILES environment variable, you can customize your PSGML installation (its manual tells you how), or you can even edit the source file psgml.el before compiling and installing PSGML, changing the hard-coded paths to match your own default. Optional: installing <productname>JadeTeX</productname> If you want to, you can also install JadeTeX to use TeX as a formatting backend for Jade. Note that this is still quite unpolished software, and will generate printed output that is inferior to what you get from the RTF backend. Still, it works all right, especially for simpler documents that don't use tables, and as both JadeTeX and the style sheets are under continuous improvement, it will certainly get better over time. To install and use JadeTeX, you will need a working installation of TeX and LaTeX2e, including the supported tools and graphics packages, Babel, AMS fonts and AMS-LaTeX, the PSNFSS extension and companion kit of "the 35 fonts", the dvips program for generating PostScript, the macro packages fancyhdr, hyperref, minitoc, url and ot2enc, and of course JadeTeX itself. All of these can be found on your friendly neighborhood CTAN site. JadeTeX does not at the time of writing come with much of an installation guide, but there is a makefile which shows what is needed. It also includes a directory cooked, wherein you'll find some of the macro packages it needs, but not all, and not complete -- at least last we looked. Before building the jadetex.fmt format file, you'll probably want to edit the jadetex.ltx file, to change the configuration of Babel to suit your locality. The line to change looks something like \RequirePackage[german,french,english]{babel}[1997/01/23] and you should obviously list only the languages you actually need, and have configured Babel for. With JadeTeX working, you should be able to generate and format TeX output for the PostgreSQL manuals by giving the commands (as above, in the doc/src/sgml directory) jade -t tex -d /usr/local/share/docbook/print/docbook.dsl -D ../graphics postgres.sgml jadetex postgres.tex jadetex postgres.tex dvips postgres.dvi Of course, when you do this, TeX will stop during the second run, and tell you that its capacity has been exceeded. This is, as far as we can tell, because of the way JadeTeX generates cross referencing information. TeX can, of course, be compiled with larger data structure sizes. The details of this will vary according to your installation. Alternate Toolsets The current stable release of sgml-tools is version 1.0.4. The v1.0 release includes some restructuring of the directory tree to more easily support additional document styles, possibly including DocBook. The only version of sgml-tools evaluated for Postgres was v0.99.0. <productname>sgml-tools</productname> Install sgml-tools-0.99.0 Apply sgml-tools-patches to the linuxdoc styles. These patches fix small problems with table formatting and with figure file names on conversion to postscript or html. <productname>sgml2latex</productname> The current stable release of sgml2latex is version 1.4. I have misplaced the original reference for this package, so will temporarily post it with this example. Install sgml2latex . <productname>latex</productname> Get and install texmf, teTeX, or another package providing full tex/latex functionality. Add the required styles linuxdoc-sgml.sty, linuxdoc-sgml-a4.sty isolatin.sty, qwertz.sty, and null.sty to texmf/tex/latex/tools/ or the appropriate area. % cat latex-styles-0.99.0.tar.gz | (cd texmf/tex/latex/tools/; tar zxvf -) Run texhash to update the tex database.