Processing RPL Predefined Function Help for use in the RiverWare Build
Phil Weinstein, CADSWES, March 2015.

This document describes the process of exporting HTML from a FrameMaker 12 RiverWare Online Help document and procecessing that content for integration into the RiverWare build.

Overview

RiverWare 6.7 displays RPL Predefined Function Online Help content, as HTML, in a QWebView panel. The initial implementation displays this help content in three RPL dialogs. See this document:

 

The Function HTML help content (a single HTML file for all, approximately 200 RPL Predefined Functions) is bound to the RiverWare executable as a Qt Resource. (A compressed copy of the page -- without images -- is part of the RiverWare executable). Referenced images are loaded dynamically by RiverWare's integrated QWebKit browser (Qt4 QWebView).

Major Process Steps:

(1) The RPL Predefined Function Online Help document is generated as HTML from FrameMaker 12. This is display-only oriented HTML content, lacking well-defined meta-data, e.g. for discerning which top-level HTML elements correspond to particular functions.

(2) A Python 3 implemented processor translates the FrameMaker HTML output into structured HTML, with semantic HTML/CSS classes and other XML attributes to identify functions (as new top-level HTML DIV elements) and the content components which make up a function block. The script also creates renamed copies of the exported images, with names based on the function blocks in which they appear. The script generates a directory containing:

  1. A single HTML file with all RPL Predefined Function help content.
  2. A subdirectory (folder) containing well-named images on that page.

(3) Automated: At run time, RiverWare builds an internal XML DOM document (in memory) from the bound HTML data and creates a function-name index for top-level function DIV elements. On demand, individual single function documents are built from those DIV elements and displayed in a Qt4 QWebKit QWebView. As mentioned above, this QWebView is deployed in three RPL Predefined Function-related dialogs.

Required Tools:

General Notes:

(1) If source document changes are needed ... check out RPLPredefinedFunctions.fm with RCS ... edit ... review ... and (perhaps later on) check in.

  1. On "alamosa" (a linux machine), in a command window, check out the source document (with a lock) using RCS.
     
  2. On Windows, START FrameMaker 12 and OPEN the document at the following analogous file path. (It's apparently normal to ignore the warnings about unavailable fonts and unresolved cross-references).
     
  3. Carefully and deliberately edit the document using the style and format conventions of the document. Most styles are important -- they are used by the python script to identify the content structure and semantic types. Also important are the row title words in the first column of each function's main table -- those are also used as keywords by the python script, e.g. Description, Type, Arguments, [Argument Numbers, starting at 1], Evaluation and optional Comments. Math formula bounding boxes should not have a lot of extra internal padding space, especially on the left side.
     
  4. Checking the edited documented back in (to RCS) can be done at any point in the following process. (It does not have to happen right now). But when you are pretty sure that your edits are complete and final, type in the following command in your "alamosa" (linux machine) command window to check your changes into RCS and unlock the file. (Refer to other RCS commands if, for some reason, the file you edited hadn't actually been locked).
     

(2) Open RPLPredefinedFunctions.fm (again) in FrameMaker 12.

(3) File >> Publish ... shows this panel:

(4) Confirm "US_ASCII" character encoding ...

(5) Double-click "WebHelp" ... this takes a few minutes ...

... click Done.

(6) View these two folders:

  1. C:\Users\philw\FMOutput\RPLPredefinedFunctions-WebHelp\
  2. C:\Riverware\staff\philw\WinPhilDoc\RwDoc\PythonDocUtils\Inputs\
  1. Create or Delete Contents of Folder: [B] fmFuncImages.
  2. Copy [A] RPLPredefinedFunctions.htm to [B].
  3. Copy [A] RPLPredefinedFunctions*.jpg and .bmp to Folder: [B] fmFuncImages.

Note: In the course of making a sequence of text-only edits, sub-step #3 above -- copying images -- is not always necessary.

(7) Open a Windows command window in
 C:\Riverware\staff\philw\WinPhilDoc\RwDoc\PythonDocUtils\

(8) Run the python script

The output of the python script is used in two places:

  1. The RiverWare build. Only the generated HTML file (and not the page's images) becomes part of the RiverWare build. (See Step 9).
  2. The RiverWare runtime file distribution. A directory including the generated HTML file and a subdirectory with the page's images is copied to the RiverWare executable directory -- or to the directory pointed to by the optional RiverWare Home environment variable. (See Step 10).

Note that both the "RwDoc/PythonDocUtils/Inputs/" directory and the generated the "RwDoc/embeddedHelp/" directory are part of the RiverWare development area under git control. That is, they both get checked in when committing changes in git.

(9) Build RiverWare in Visual Studio

(10) Copy the generated directory to the RiverWare executable directory -- and ultimately to the RiverWare release deployment area.

(11) Test, and with Git Extensions: commit and push changes.

--- (end) ---