This chapter provides an overview of the structuring process. Details of converting documents are also in this chapter.
The chapter is broken down into eight parts:
This section presents the general steps and procedures needed to put a document online in either DynaText or PinPoint. A graphical representation of the structuring process is given Figure 1.
The procedures in the remainder of this manual cover the details of the conversion process. Any questions that the overview brings up are answered in the remaining sections of this manual.
Figure 1 gives an overview of the structuring process at the file level. This process assumes the file to be converted uses the Convex FrameBuilder V4.x template or the FrameMaker V4.x template (though these templates can be used in FrameMaker V5.x).
Figure 1 Overview: converting OpenBook to DocBook
Figure 2 Overview: saving to SGML
This section tells you what tasks you need to perform in preparation for structuring a file.
NOTE: Always back up your files before converting them. Also, take one file through the entire conversion process to get a feel for how all the parts work together in producing the online document--in particular, the conversion table may not be mapping some fonts that you use frequently to elements.
See the "Available utilities" section on page 25 for information on the utilities needed to perform the various tasks involved in converting a document to FM+SGML using the Ramer template. The tasks themselves are discussed in the remainder of this chapter.
% cd
my_working_directory
% mkdir templates
% cd templates
% cp -r /usr/spool/globdata/etc/FrameTemplates/FMSGML/* .
Alternatively, you can open template files by selecting File ->New -> Convex/desired_template then save the individual file to your working directory. You must save the template before FM+SGML allows you to use it for importing element definitions or generating structure.
The File -> New -> ... setup may not be available if you are running FM+SGML on your workstation. If you would like this setup on your workstation, see the section "Running FM+SGML on your workstation" section on page 37.
open2doc-1.pl
.
open2doc-1.pl
on the file. The open2doc-1.pl
script is
in icarus:/usr/local/doctools/open2doc/.
Caution: Do not start anopen2doc-1.pl
oropen2doc-2.pl
script if you have one of the scripts currently running.
Generating structure for a file is the easiest step in converting a file to an online document.
Assuming you set up your template directory as indicated in the "Preparing to structure" section on page 4, the conversion table is located at my_working_directory/templates/conversion/conversion.table. Otherwise, the table can be opened through File -> New -> Convex/ -> conversion.table on idiom or icarus. You must save the file before it can be used in generating structure.
NOTE: The conversion table uses paragraph and character tags from the FrameBuilder/FrameMaker v4.x templates. If your files use tags not found in those templates--or you modified the existing tags--the structure generation will be hindered.
denotes the chapter number and the book of the file you are structuring. For example, the structured version of Chapter 1 in the book Foo User's Guide could be named 01fooug.fm5.struct.
NOTE: After generating structure, your converted file may have many blank pages following the text. These pages are added due to a bug in FM+SGML thatmifmucker
(throughopen2doc-1.pl
) reveals. Delete these pages using the command Special -> Delete Pages.
Once a file's structure has been generated, it must be validated. At its simplest, validating is a game of connecting the dots--only the dots are elements. You achieve a valid structure by arranging the elements in a manner that conforms to the Element Definition Document (EDD).
The EDD governs the organization of the document by allowing only certain elements to be used within or following any particular element. See Peter's course notes for more information on how EDDs work. The course notes are FrameMaker V4.x files and are located in icarus:/home/cash/work/training.
The Structure View window and the Elements window (commonly referred to as the Element Catalog) are crucial to the validation process. The Structure View displays the structure of the document, while the catalog lists elements.
In the FM+SGML document, select the [ ] square at the top of the right scroll bar of the FM+SGML window to display the Element Catalog. Then select the square containing the "bubble diagram" immediately below the [ ] square to open a Structure View window.
Figure 3 Displaying the Structure View and the Element Catalog
To determine which elements are valid for a particular location in a document, place the cursor in the corresponding location in the structure view and click the left mouse button.
Note how the Element Catalog changes in the next two figures as the cursor location changes.
In Figure 4, the left mouse button was pressed with the cursor between the <Sect2> elements. As indicated by the checkmarks, the first three elements in the Element Catalog are valid (can be inserted "legally") at that position; the plus marks (+) next to check marks indicate that the associated elements are valid at the current level and also at the next deeper level. The question marks next to elements 4 through 8 indicate that those elements are valid for the current location, but if inserted, any sibling and children elements would become invalid.
Figure 4 Element catalog with cursor after <Sect2> element
In Figure 5, the left mouse button was pressed with the cursor between the <Title> and <Para> elements. All the elements visible in the catalog are valid for the new cursor location.
Figure 5 Element catalog with cursor after <Title> element
When viewing the Element Catalog, note that the elements that are valid for the current location of the cursor are at the top of the list, with checkmarks to the left (see Figure 4). (All elements listed may have checkmarks depending on the display option selected.)
To view all elements, select the Options button at the bottom of the Elements window (see Figure 5). In the resulting window, select All Elements.
Having all elements listed is useful because you can wrap text in an invalid element, then move the element (and its text) to a location at which that element is valid. Also, if you define any keyboard macros, having all elements available is sometimes necessary.
With a newly opened document, the Element Catalog defaults to displaying only the valid elements, unless the file had previously been saved with the catalog showing all elements (or some other display option).
The FM+SGML file can be edited in both the main window and in the Structure View window. In the latter case, editing is restricted to elements; the elements can be cut, copied, pasted, or moved. In Figure 6, the highlighted section of the Structure View corresponds to the highlighted section of the document.
Figure 6 Document and Structure View
The list below details actions that you must perform for every newly structured file. If you feel that more of your document should have been wrapped by the conversion table, go back to your FrameBuilder/FrameMaker V4.x and re-tag the paragraphs or characters to match the entries in the conversion table, or if you used template tags that are not being wrapped, request a change in the conversion table by contacting Peter Cash (x4389).
open2doc-2.pl
on the file. You do not need to
run this script on files that do not contain figures. If you use a
script or alias named either maker or makersgml on icarus,
temporarily disable the script/alias before using
open2doc-2.pl
.
The open2doc-2.pl
script fixes figures by changing the fill
to 0%. The script is in icarus:/usr/local/doctools/open2doc/.
NOTE: If your vector graphics rely on an object's being transparent, you will have to also manually fix those graphics to achieve your intended effects.
or
Elements Listed by ID
Look at the templates for examples of structured documents.
To browse the Chapter template, select
File -> New -> Convex/ -> Chapter. Alternatively, you can open
the file at
/usr/spool/globdata/etc/FrameTemplates/FMSGML/Chapter.
You may also want to print the template with the element tags showing. To display element tags in FM+SGML, select View -> Element Boundaries (as Tags).
The templates can be very helpful in determing how to wrap items. The template directory contains the following files:
Chapter |
SampleLOF.doc |
Sample_Preface |
README |
SampleLOT.doc |
Sample_glossary |
Sample.book |
SampleTOC.doc |
conversion/ |
SampleIX.doc |
Sample_Appendix |
title.doc |
Once you have validated all the files of a book, validate the book file itself--including the TOC, LOF, LOT, and Index, as well as the frontmatter (title and copyright information).
To structure the frontmatter:
Although the generated files (TOC, LOF, LOT, and Index) are not saved to SGML (and not needed online), you can validate them and leave them in the book file. (You can also remove them from your book file before saving to SGML.)
To validate a generated file:
Generated file |
Set up to include the elements* |
---|---|
TOC |
Appendix, Chapter, Glossary, Index, Preface, Sect1, Sect2, Sect3 |
LOF |
Figure |
LOT |
Table |
Index |
Index |
You will be prompted to select attributes for the new element; do not select any attributes, just choose Wrap Element.
Generated file: |
Element to wrap in: |
---|---|
TOC (Table of Contents) |
ToC |
LOF (List of Figures) |
LoT |
LOT (List of Tables) |
LoT |
Index |
Index |
To validate a book select (from the document window menu bar) Element -> Validate... -> Start Validating with the Entire Document option selected. All component files must be valid for the book to be valid.
Figure 7 Valid structure view of a book
After validating a book file, save the book in the SGML format as discussed in the "Saving to SGML" section on page 16.
Your book's structure view may show an element named <BOOK-COMPONENT>. This element appears when files are added to a structured book.
To validate the book's structure:
Assuming the file is structured correctly and placed in the book in the right position, the book's structure will be valid when generation completes.
When the document's structure is valid, save the document to SGML by using the File -> Save as item with the SGML format selected. Any errors encountered are logged by the application and displayed once the save has completed as much as it can.
Performing the SGML save requires (more accurately, the EBT products require) a specific directory setup in your working directory. This setup is described below.
NOTE: Before saving (exporting) or importing any SGML, you must:
1. Open the following file:
icarus:/work/packages/frame/fmsgml/fminit/usenglish/sgml/docbook/app/sgmlapps.doc.
2. In the sgmlapps.doc file you just opened, execute the command
File -> Developer Tools -> Reread SGML Application File (you only need to execute this command once per FM+SGML session).
3. In the file you are exporting, make sure the SGML application is set to DocBook; check this by executing the command File -> Set SGML application. Change the SGML application to DocBook if need be.
% cd /work/cold/collections/test_cols/docbook/books/
% mkdir
MyBook
where
% mkdir
MyBook/figures
You can save your document to SGML once you have performed the steps outlined in the preceding section. The SGML save can be performed on a single chapter or on an entire book.
If you are saving a book to SGML, generate a book file called book.fm5.struct that contains all the *.fm5.struct files--including the frontmatter (title page and copyright information) and generated files (TOC, LOF, LOT, Index). The validation of generated files is discussed in the section "Validating a book" section on page 13.
Be sure to generate the book to update cross-references. Unresolved cross-references will appear as question marks online.
Validate the book's structure. See Figure 7 in this chapter for a valid structure view of a book file.
NOTE: FM+SGML considers an SGML export as a save operation--there is no confirmation of a successful export. (This behavior differs from FrameBuilder.)
Some messages have hyperlinks to the errors. Click on a link to go to the source of an error, and then determine the best manner in which to fix the given problem. Call Peter Cash (x4389) or Scott Cox (x4710) with questions.
There are numerous warning and error messages displayed after the SGML save is completed. Of course, you also get messages if the save is not completed. Listed below are some of these messages and methods to correct the corresponding problems.
This message is generated when there is not a figures subdirectory in the directory being exported to. FM+SGML cannot export the element because it is trying to export the graphic into a subdirectory that does not exist.
Make a figures subdirectory (as described in the section "Setting up to perform the SGML save" section on page 16) and perform the SGML save again.
This message is generated if the sgmlapps.doc file has not been read. Read the file as described in the section "Setting up to perform the SGML save" section on page 16.
(X and Y are positive numbers.)
This message is generally bogus; you can safely ignore it in most cases.
After exporting your file to SGML, you can view it online using DynaText (or PinPoint). However, you first need to set up DynaText (or PinPoint) and compile the SGML file.
In order to use DynaText (or PinPoint) to read your files online, you should perform the following steps on icarus:
%
cp /usr/ebt/data/.ebtrc ~/.ebtrc.mine
%
setenv EBTRC /home/
login/.ebtrc.mine
%
setenv RCPATHNAME $EBTRC
where
is your user name.
COLLECTION /work/cold/collections/test_cols/docbook=My Collection
where
is any string you want
%
cd
/work/cold/collections/test_cols/docbook/books/
MyBook
%
cp /work/cold/collections/test_cols/docbook/ents/styles.ent .
where
is the book directory you created in the section "Setting up to perform the SGML save" section on page 16.
NOTE: This styles.ent is only for informal, everyday use. You may need a book-specific styles.ent file for performing online QAs. Contact Peter Cash (cash, x4389) for more information.
In order to view your file in DynaText (or PinPoint), you will need
to "compile" your SGML file with mkbook
. To do this, use the
following command on icarus (make sure /usr/ebt/bin is in your
path):
% mkbook -fa -col /work/cold/collections/test_cols/docbook
MyBook
where
is the book directory you created in the section "Setting up to perform the SGML save" section on page 16.
shrinktif.pl
)Currently, the SGML save produces graphics in the tiff format that
are too large to use. The script shrinktif.pl
reduces the size of
the graphics. This script is located in
icarus:/usr/local/doctools/bin/.
If you already have /usr/local/doctools/bin in your path but the
script is not being found, execute the rehash
command:
%
rehash
Use the script on the tiff files in your figures subdirectory as indicated below:
% cd /work/cold/collections/test_cols/docbook/books/
MyBook/figures
% shrinktif.pl [-size
value] *.tif
where
is the book directory you created in the section "Setting up to perform the SGML save" section on page 16.
-size
value
is an optional command-line option you can use to control the amount figures are reduced. Valid value amounts are: 0.375, 0.5, 0.625, and 0.75.
NOTE: After using theshrinktif.pl
script, your graphics may still be too large or may be unreadable. Check the graphics immediately after running the script by using thexv
program (in icarus:/usr/local/doctools/bin). Also, the graphics may be rendered ineffective by theopen2doc-2.pl
script--this problem can be fixed manually. Ask Ken Harward (x4980) or Scott Cox (x4710) for assistance.
The file can be viewed by performing the following steps:
% /usr/ebt/bin/dtext
Start PinPoint on icarus:
% /usr/pinpoint/bin/pinpoint
When you make changes to your file and re-export it, overwrite
your previous SGML output file and run mkbook
on the new file.
Do not keep creating new directories each time you change a file.
See PinPoint's online help for information on customizing the appearance and behavior of PinPoint.
Once you have your file in DynaText (or PinPoint), you must review it. For information on reviewing DynaText (or PinPoint) books, see the PinPoint Book QA Process and Checklist at http://wwwcpress/pinpoint/ppbookQA.html.
Repeatedly adjust the document`s element structure (exporting and viewing the results) until the online document satisfactorily matches the hard copy.
Stylesheets determine how an element is formatted in DynaText and in PinPoint. If your document is validly structured but does not look right online, you can request a change to the stylesheets.
The PinPoint Style Issues and bugs web page (http://wwwcpress/pinpoint/ppstyle_changes.html) defines the procedure for requesting stylesheet changes.
After you are finished testing your book, please delete your files from the icarus file system, as indicated below:
%
rm -r /work/cold/collections/test_cols/docbook/books/
MyBook
where
is the book directory you created in the section "Setting up to perform the SGML save" section on page 16.