WWW Meets FrameMaker

I have just completed the first steps in integrating FrameMaker and the World Wide Web. You can now create, read, modify, and write web documents using FrameMaker. Soon, you should be able to use FrameMaker as a global hypertext browser.

Daniel W. Connolly <connolly@convex.com>

Theory of Operation

FrameMaker supports an interchange format and an integrated conversion facility. See p. D-16 of FrameMaker Reference for full documentation.

Reading HTML

Basically, whenever you open or save a file (in MIF format), if the filename matches a suffix list, Frame invokes a shell script that can convert the file on the fly.

I modified the supplied MifRead script to recognize HTML. Files ending with .html are filtered them through fix-html.pl , which brings conventional HTML files into SGML conformance. Then sgmls parses the file using html.dtd . (sgmls does a pretty good job of tolerating errors in SGML instances.)

Then html2mml.l and the xlisp interpreter convert the sgmls output to Maker Markup Language. Finally, MifRead calls FrameUs mmltomif to generate the MIF file that FrameMaker will read.

Writing HTML

I modified the supplied MifWrite to convert MIF files saved with the .html extension to HTML. The xlisp program mif2html.l does the whole conversion.

Hypertext Constructs in Frame and WWW

FrameMaker supports hypertext references using markers with MType=8 (Hypertext in the dialog box.) The active text is everyting from the marker to the next font change before and after the marker.

Associated with the marker is a text string. FrameMaker defines a set of hypertext commands. See p. 3-8 of FrameMaker Reference for details.

Three of the commands are supported by the www_and_frame package: gotolink, newlink, and message.

The syntax of gotolink is

gotolink filename:linkspec gotolink linkspec gotolink filename:firstpage which are translated to anchor start tags of the form:

<A HREF="file:filename#linkspec"> <A HREF="#linkspec"> <A HREF="file:filename"> The syntax of newlink is

newlink linkspec which I translated to

<A NAME="linkspec"> The syntax of message is

message clientname string which, if clientname is www, I translated to

<A HREF="string"> The catch is that you have to put the hypertext marker at the beginning of the anchor text. If you put it in the middle, Frame will recoginze the whole anchor, but these tools will only recognize the text between the marker and the next font change.

The inverse translations arenUt as fully functional. They currently map

<A NAME="n" HREF="h"> to

message www h The result is that target anchors are generally lost on input. This should be fixed shortly.

Installation

The www_and_frame package

The www_and_frame.tar.Z file will be available via anonymous ftp shortly from info.cern.ch in the pub/WWW/src directory.

The command

zcat www_and_frame.tar.Z | tar xvf - should properly install the package in a directory called .fminit2.0.

The LISP interpreter: xlisp by David Betz

Grab export.lcs.mit.edu:/contrib/winterp/xlisp/xlisp-2.1.almy.tar.Z via anonymous FTP. Then apply the patches in diffs_from_almy21. These patches prevent xlisp from writing diagnostics to stdout where they will be mixed in with conversion output.

Then build it using the included directions. You may have to tweak it a little for your system.

IUd like to make this package a little more ANSI/POSIX conformant if I get time. But for now, youUll have to do the typical Makefile editing.

The SGML parser: sgmls by James Clark

Grab ifi.uio.no:/pub/SGML/SGMLS/sgmls-0.8.tar or ftp.uu.net:/pub/text-processing/sgml/sgmls-0.8.tar.Z

This package is extremely high quality. It includes a configure shell script, and it is largely ANSI/POSIX compliant. It builds without modification on all the systems IUve tried.

Try It Out!

Load the test file into FrameMaker

Be sure you have the following requirements met first:

  1. The .fminit2.0 directory from the www_and_frame package is in the current directory or in your home directory.
  2. The suffixes file in that directory has an entry for html.
  3. The MifRead shell script in the fminit directory checks for html processing.
  4. The fix-html.pl perl script is executable and in your $PATH.
  5. The sgmls parser is executable and in your $PATH.
  6. The html.dtd file is in the current directory or accessible via the SGML_PATH envariable. (See the sgmls man page for details.)
  7. The html2mml.l lisp program is in the current directory.
Then start FrameMaker, chose open from the File menu and select test.html. FrameMaker will consult the suffixes file, and upon finding the html entry, it will run MifRead. MifRead will invoke fix-html.pl to bring test.html into SGML conformance. Then it will invoke sgmls to parse the file, and html2mml.l to convert the parsed SGML to Maker Markup Language. Finally, mmltomif is invoked to build an importable file.

You should be able to edit the file normally. Use only the paragraph tags in the catalog. You can, however, change any attributes of those tags.

You can add hypertext links by adding FrameMaker hypertext markers. For the marker text, the "gotolink foo:bar" and "newlink bar" syntaxes are supported. Plus, use "message www scheme://host/path#anchor" for full WWW addresses.

You will have to lock the file to use the hypertext links interactively. (use ESC-F-l-k to lock/unlock the file.)

Save the test file in HTML format

When you want to save the file, be sure these requirements are met:

  1. The MifWrite shell script is in the .fminit directory and checks for html processing.
  2. The xlisp interpreter is executable and in your $PATH.
  3. The mif2html.l lisp program is in the .fminit2.0 directory.
Then just chose Save As... and be sure the extension is .html. Click the Maker Interchange Format option, and click OK. Frame will invoke MifWrite, which will invoke the mif2html.l lisp program.

The resulting file should be acceptable to the www browsers.

Updates to the HTML DTD

For the functionality that I implemented, no changes to the WWW code are necessary. HTML files and programs that generate HTML do require changes.

The FrameMaker integration is based on the premise that WWW will become an SGML compliant application. I am using the DTD that I proposed recently with some modifications to closely parallel HTML.c from the distributed code. I also consulted the proposed HTML2 definition .

The fix-html.pl script should bring most existing HTML files into compliance.

Future Directions

The documentation for FrameMaker includes Integrating Applications with FrameMaker, which desciribes a mechanism where arbitrary RPC clients can be invoked from hypertext commands.

That is, the incantation

message www http://info.cern.ch/hypertext/WWW/MarkUp/HTML2.html could make an RCP call to a WWW client that would retrieve the indicated document and instruct FrameMaker to display that file.

This would turn FrameMaker into a global hypertext browser.

To Do

Bibliography

MIF
MIF ReferenceFrame Technology Corporation1010 Rincon CircleSan Jose, California 95131Part Number 41-01037-00April 1991
FrameMaker Reference
FrameMaker ReferenceFrame Technology Corporation1010 Rincon CircleSan Jose, California 95131Part Number 41-00524-00Septermber 1990