Chapter 5. Building Online Books

The book building process creates SGML files from FrameMaker source files and generates the additional files required to build manuals that are viewable with IRIS InSight and SGIHelp. The build process also generates error reports that are used to debug source files so that, after a number of iterations, an error-free online document is created.

Before you can build a book, ensure that your workarea is ready. Install the book building tools as described in “Installing Software Packages”. Set up your workarea as described in “Setting Up the Workarea”.

The build process is invoked with the make command, which takes a variety of arguments. To build a book, the make command reads a file called Makefile, which contains information that defines the built book. Once a book is built, you can proofread it with IRIS InSight to spot any errors in the online version.

This chapter explains how to edit a Makefile, build a localized book, generate error reports, and view the built book with IRIS InSight. The chapter includes these sections:


Note: The build process will go more smoothly if you generate and update the FrameMaker bookfile and compose and import localized figures before beginning the build.


Editing the Makefile

The Makefile file specifies the FrameMaker files that compose the book and information about the figure files in the book. Makefile also specifies the short title of your book, which is used for hypertext links and appears in the online icon of the book. The short title also specifies foreign language attributes and determines the bookshelf where the book is displayed for selection by users. “Basic Book Set: Short Titles and Part Numbers” shows some examples of short titles. An edited version of the Makefile file must be stored in your local working directory.

Table 5-1 lists the files that you should and should not include in the Makefile.

Table 5-1. Files to Include and Omit in Makefile

Include

Omit

Front matter file

Table of Contents

Introduction or Preface file

List of Figures

Chapter files

List of Tables

Appendix files

Index

Glossary file

Book file

Before you start the bookbuild, check to be sure that the parameters listed in Table 5-2 are correct in the localized Makefile.

Table 5-2. Makefile Parameters for WorldView European

Parameter

German

French

Spanish

TITLE

short_title
(same as English)

short_title
(same as English)

short_title
(same as English)

FULL TITLE

Localized book title

Localized book title

Localized book title

VERSION

XXX-XXXX-XXXDE

XXX-XXXX-XXXFR

XXX-XXXX-XXXES

BOOKSHELF

 

 

 

 help books

/usr/share/Insight/library/
de_bookshelves/Help

/usr/share/Insight/library/
fr_bookshelves/Help

/usr/share/Insight/library/
es_bookshelves/Help

 end-user books

/usr/share/Insight/library/
de_bookshelves/
SGI_EndUser_Deutsch

/usr/share/Insight/library/
fr_bookshelves/
SGI_EndUser_Francais

/usr/share/Insight/library/
es_bookshelves/
SGI_EndUser_Spanish

 admin books

/usr/share/Insight/library/
de_bookshelves/
SGI_Admin_Deutsch

/usr/share/Insight/library/
fr_bookshelves/
SGI_Admin_Francais

/usr/share/Insight/library/
es_bookshelves/
SGI_Admin_Spanish

BOOK_ICON

 

 

 

 help books

generic

generic

generic

 end-user books

sgi_end_user

sgi_end_user

sgi_end_user

 admin books

sgi_admin

sgi_admin

sgi_admin

BOOK_LANG

de

fr

es

DTD

SGIDOC

SGIDOC

SGIDOC

DOC_TYPE

MANUAL

MANUAL

MANUAL

SORT_ORDER

precede with “#”

precede with “#”

precede with “#” for all except IRIX Admin books, then use English sort order number

HIDDEN

 

 

 

 for help books

TRUE

TRUE

TRUE

 for all others

FALSE

FALSE

FALSE

For European books, the following line needs to be inserted between the BOOK_LANG and DTD parameters:

BOOKSUBSYSTEM != echo `echo $(BOOK_LANG) | tr `[a-z]' `[A-Z]'`_$(BOOKSUBSYSTEM)

Table 5-3 lists the parameters for Japanese books.

Table 5-3. Makefile Parameters for WorldView Japanese

Parameter

Japanese

TITLE

short_title
(same as English)

FULL TITLE

English book title followed by “(Japanese)”

VERSION

XXX-XXXX-XXXJP

BOOKSHELF

 

 help books

/usr/share/Insight/library/ja_JP.EUC_bookshelves/Help

 end-user books

/usr/share/Insight/library/ja_JP.EUC_bookshelves/SGI_EndUser_Japanese

 admin books

/usr/share/Insight/library/ja_JP.EUC_bookshelves/SGI_Admin_Japanese

BOOK_ICON

 

 help books

generic

 end-user books

sgi_end_user

 admin books

sgi_admin

BOOK_LANG

ja_JP.EUC

DTD

SGIDOC

DOC_TYPE

MANUAL

SORT_ORDER

Precede with “#” for all except IRIX Admin books, then use English sort order number

HIDDEN

 

 for help books

TRUE

 for all others

FALSE

BOOK_FILES

List .doc files


Files and Directories Generated by make

You can run make with a number of different arguments. The argument that you use determines the generated files that result from the build. The make command produces two different types of files: intermediate files and error files. Intermediate files are artifacts of the build process. make must produce these files in the course of creating an online book and they can be used to speed up book builds when only part of the book source has changed. They are also sources for error files, which are reports of various types of source errors detected during the build process. Generating error files is not a necessary step in the build process and, though it is generally not recommended, it is possible to create on online book without generating any error files.


Note: For instructions on how to find and fix errors reported in the various error files, see Chapter 6, “Debugging Bookbuild Errors.”

As the final step in the build process, make produces a directory called ~/books/parent_directory/partnumber that contains the online version of the book. See “Viewing and Testing an Uninstalled Book” for instructions on how to view a built book.

Because the build process is a sequence of steps, make commands that take source files closer to a finished online book necessarily require that all earlier steps are completed. Likewise, error files that require certain intermediate files will cause those files to be updated, if necessary, before an error report is generated.

Figure 5-1 shows where the various intermediate and error files are produced during the build process.

Figure 5-1. Files Produced During the make Process


Intermediate Files

make generates a sequence of intermediate files in the process of creating an online document. Some are specific to individual source files; others are compilations of information generated from all the source files for a book. All of these files appear in your document directory. They are generated automatically as part of the online build process. However, by using different make commands, you can produce various sets of these files.

.mif files 

These are ASCII versions of the FrameMaker .doc files. The SGML translation software reads and converts theses files to SGML.

.sgm files 

These are individual SGML files, one for each FrameMaker file listed in the Makefile. They are produced from the .mif files by the SGML translation software.

shortname.idx file 


This file contains index information for the SGML version of the book.

booklist.txt file 

This file contains the bookshelf, book icon, language, title, short_title, part number, and hidden variable information from the Makefile.

shortname.sgml file 


This file contains the concatenated SGML for all the files listed in the Makefile. It also includes all the information from the shortname.idx file.

Error Files

Error files list errors from the various intermediate files. For instructions on how to find and fix errors, see Chapter 6, “Debugging Bookbuild Errors.”

.err files  

A .err file contains errors and warnings generated from the corresponding .sgm or .sgml file. You should fix all messages labeled ERROR, but you may ignore the messages labeled WARNING.

shortname.full file  


The make book.full command generates a file called shortname.full that contains a complete error report for the entire book. This is the only error report that contains information on links.

books Directory

When you run a version of make that generates an online book, it produces a directory called ~/books/parent_directory/partnumber that contains the online version of the book. See “Viewing and Testing an Uninstalled Book” for instructions on how to view a built book.

Arguments to the make Command

The make command takes many arguments, giving you flexibility to build different pieces of your book or selected error files. Because the build process is a sequence of steps, make commands that require more steps will necessarily take longer (Figure 5-1 shows the basic sequence).

A complete book build can take anywhere from 15 seconds to 30 minutes or more, depending on the size of the book, the speed of your workstation, and the amount of activity on your workstation. Subsequent builds take less time, depending on the number of source files that you edited since your previous build.

Table 5-4 lists the commands for the entire book. For any command in Table 5-4, you can substitute the short_title of your book for book.

Table 5-4. make Commands For the Entire Book

Command

Output

make book.sgml

shortname.sgml file from individual filename.sgm files

make book.err

shortname.err error/warning report from the shortname.sgml file

make book

a books subdirectory containing a viewable book from the shortname.sgml file and figures in the online directory

make book.full

shortname.full file (containing all error information, including link error reports that aren't available from any other make command)

Table 5-5 lists the commands for individual files. Use these commands on individual FrameMaker files.

Table 5-5. make Commands For Single Frame Files

Command

Output

make filename.mif

Frame MIF file from filename.doc

make filename.sgm

SGML file from filename.mif

make filename.err

error/warning report on filename.sgm


Choosing a make Command Argument

The make command argument that you choose depends on the stage of development of your book. Use these recommendations as a general strategy for choosing a make argument:

  • Run make book.full on a book fairly early in the development process to generate error reports that you can use to begin debugging. Try and clean up as many of these errors as possible before creating your first viewable book.

  • After cleaning up many of the errors from your initial make book.full, you can produce .err files for individual source files as you continue development. You should also produce periodic make book files to monitor the progress of your online book.

  • Finally, you must run make book.full and verify that your shortame.full file contains no errors that you should fix. Then run make book to make sure the book is viewable with IRIS InSight, that all figures and tables work, and that the book looks the way you want it to look.

The make commands provide some information as they run; this information appears in the window from which you issued the command. If a make command encounters an unresolvable error, an error message and prompt are posted. If a make command terminates abnormally, see “If make Doesn't Work” for suggestions about how to find the problem.

For instructions on how to find and fix errors that appear in the various error reports generated by make, see Chapter 6, “Debugging Bookbuild Errors.”

Initial make: make book.full

As a first step in the debugging process, use the make book.full command to build the SGML files with full error reports. This does not produce a viewable book. Try to eliminate as many of the easy, obvious errors as you can before you try and view your book. After you've fixed the errors, you can build the viewable book using make book.

To run make book.full, follow this procedure:

  1. Close all your FrameMaker files.

  2. Change to your local working directory.

    cd ~/books/parent_directory/partnumber 
    

  3. Follow the directions in “Building European Books” for building European language books or “Building Japanese Books” for Japanese language books.

The make book.full command converts your FrameMaker files into SGML and creates a complete error report file that you can use to “debug” your book. (Chapter 6, “Debugging Bookbuild Errors” explains how to do this.) This complete error report is called shortname.full, where shortname is the short_title of your book. make book.full usually takes between 30 seconds and 30 minutes to convert a new book, depending on the size and contents of the book.

Debugging Individual Files: filename.err

It's rarely worth trying to rebuild the entire book every time you make a change. This takes time and CPU cycles, and in many cases the amount of noticeable change is minimal. A better strategy is clean up and rebuild files individually. This way, you can work on some files while others are building in the background.

The error report you need to produce is the .err file. To produce a .err file for a single source file, enter

make filename.err 

See Chapter 6, “Debugging Bookbuild Errors” for instructions on fixing errors.

Book Error Files: book.err

make book.err produces concatenated files containing error information for entire books. This can be very helpful, but it can take some time if a number of your source files have changed and make has to go back and produce all the required intermediate files before creating your error report. Be sure you really want to do this rather than produce individual .err files.


Note: If you just want to see a concatenated version of all your .err files, use this command: more *.err. To save the output in a file, add > filename to the end of your command.

To produce a .err file for a book, enter

make book.err 

Making a Viewable Book: make book

If you want to view your book online and aren't interested in the error reports:

  1. Close all your FrameMaker files.

  2. Change to your local working directory:

    cd ~/books/parent_directory/partnumber 
    

  3. Enter the make book command:

    make book 
    

This command builds the files needed to display your book in the IRIS InSight viewer. “Viewing and Testing an Uninstalled Book” explains how to view the book in IRIS InSight.

Verifying an Error-Free Book: make book.full and make book

The last thing you should do is to run make book.full to verify that you have cleaned out all the errors in your book, then run make book to verify that your online book builds and that it looks the way you want it to. Chances are at least some (if not most) of your files have not been touched since you last built them (either individually or as part of a book build), and make is smart enough to use intermediate files if the source remains unchanged.

To build your book with make book.full:

  1. Close all your FrameMaker files.

  2. Change to your local working directory:

    cd ~/books/parent_directory/partnumber 
    

  3. Enter the make command:

    make book.full 
    

  4. To produce the viewable online book, enter:

    make book 
    

Building the Localized Book

Use the same steps to build a localized book in your workarea as you would an English book. For Japanese books, move the .doc files to a separate subdirectory named docs prior to starting the build on a Silicon Graphics workstation. The build tools do not work on FrameMaker for Japanese files, but instead require the .mif files to build the book. European language books can be built directly from their FrameMaker source.


Note: It is not necessary to change the show/hide settings for conditional text prior to building books. A template with the correct settings, conditional.doc, is automatically applied during the .doc to .mif translation of the book build.


Building European Books

As described in “Building the Localized Book,” European books are built from their FrameMaker source.

To build the book:

  1. Generate the SGML files and error reports:

    % make book.full 
    

  2. Check the .full file to make sure there are no errors or unresolved cross references:

    % more *.full 
    

  3. If an error or unresolved cross reference exists, and if the error is correctable without the aid of a linguist, make the correction and rebuild the book.

To install the book, follow the directions in “Installing a Localized Book for Testing”.

To set up the side-by-side test of a European manual against its English equivalent, follow the directions in “Preparing for Comparative Testing”.

Building Japanese Books

As described in “Building the Localized Book,” Japanese books cannot be built from their FrameMaker source.

  1. Move the .doc files to a separate subdirectory named docs prior to starting the build:

    % mkdir docs 
    % mv *.doc docs/ 
    

    The build tools do not work on FrameMaker for Japanese files, but instead use the .mif files to build the book.


    Note: You do not need to change the suffix of the filenames in the Makefile when building from .mif files. The tools recognize that .mif files exist for the .docs listed in the Makefile and perform the bookbuild by starting with the mif-to-sgm translation.


  2. Generate the SGML files and error reports:

    % make book.full 
    

  3. Check the .full file to make sure there are no errors or unresolved cross references:

    % more *.full 
    

  4. If an error or unresolved cross reference exists, and it is correctable without the aid of a linguist, make the correction and rebuild the book.

To install the book, follow the directions in “Installing a Localized Book for Testing”. To set up the side-by-side test of a Japanese manual against its English equivalent, following the directions in “Preparing for Comparative Testing”.

If make Doesn't Work

If a make command doesn't work, use these suggestions to correct the problem:

  • Try to interpret the error message. See “make book Error Messages” and Chapter 6, “Debugging Bookbuild Errors,” for error messages and their meanings.

  • Make sure the permissions are right: you need permission to read, write, and execute the Makefile.

  • Check the Makefile to make sure all the filenames are spelled correctly, and that there are no extra spaces after the short_title or backslashes (\).

  • Check that your list of FrameMaker files includes a backslash (\) at the end of each line except the last.

  • Make sure that any pathnames derived from automount are less than 48 characters long.

  • Make sure your online tools and book files are where the make book commands think they should be:

    • “Installing Software Packages” describes where the bookbuild tools should be installed.

    • “Setting Up the Workarea” describes how and where to set the relevant variables.

    • If your files aren't named properly, make book won't work. FrameMaker files must end in the .doc suffix and RGB figures must end in the .rgb suffix.

  • Try using make -n book.full (or use -n with any of the make commands). This tells you exactly what make is trying to do. Look for extra spaces, misspelled filenames, or anything else that doesn't look quite right.

If you can't find the problem, get help from your production editor.

make book Error Messages

This section lists some specific error messages and their causes.

Error message:

FrameMaker reports error -1 “File already locked by login @ machine on date
*** Error code 1
smake: 1 error

login is a login name (probably yours), machine is a machine name (probably yours), and date is a date (probably the current date). This means make book can't open one (or more) of the FrameMaker files because it's locked. Close all your FrameMaker files and try again. If you don't have any open FrameMaker files, look through your book directory and remove any files that end in .lck. Try make book again. Another possible problem could be that someone else has logged in to your machine and moved or opened your files.

Error Message:

========Building master SGML File========
cat: cannot open .sgml.tmp
*** Error code 2
---Shortname ---
cat: cannot open .sgml.tmp
***Error code 2
smake: 2 errors

Here, Shortname is the short_title of your book. This error message isn't quite so informative. If you get something like this, open your Makefile and look at the line that lists the short_title of the book. Look for extra spaces or punctuation. In this case, there is an extra space following the short name of the book. Make sure the short name listed here is the same as the directory name for your FrameMaker files.

Error Message:

"Makefile", line 16: Could not find /e/templates/make/commonbookdefs
"Makefile", line 51: Could not find include file '${COMMONBOOKRULES}'
Fatal errors encountered -- cannot continue

The online tools are not properly installed.

Error Message:

--- shortname.sgm.mif ---
starting maker ...
 
No call from FrameMaker after 360 seconds
Giving up.
maker: Using //e/frame/.fminit2.0.ps


Note: This example is not applicable to Japanese books.

Here, shortname is the short_title of your book. This message means that the tools can't start up FrameMaker. If you're running automount, that's probably your problem. Kill automount. Otherwise, it's probably your network connection to king. Make a copy of the /e/.env file, putting it in your home directory. Edit your new .env file, changing the FMHOME variable to point to your local copy of FrameMaker. Then, enter

source ~/.env 

Try to make the book again. If it's still unsuccessful, contact your production editor.