Subject: | Re: Displaying RPL Function Documentation in RiverWare / Python Processing | |
---|---|---|
Date: | Sun, 30 Mar 2014 22:45:42 -0600 | |
From: | Phil Weinstein | |
To: | cadswes software group |
...
I substantially succeeded in writing a Python script to translate FrameMaker generated HTML into HTML usable within RiverWare. The resulting HTML has semantic markup and resolves most of the formatting problems (e.g. for flexible display width). And it's about only 25% of the original size from FrameMaker -- could be less with more terse HTML/CSS class names:
Python Script Output [682K]:
http://cadswes2.colorado.edu/~philw/2014/RplDocDesign/PythonWork/test1/GenPredefinedFunctions.html
Original FrameMaker Output [2545K]: (with 6 types of character replacements*):
http://cadswes2.colorado.edu/~philw/2014/RplDocDesign/PythonWork/test1/RPLPredefinedFunctions_FM12_Fix.htm
There are still some problems (e.g. with bulleted lists) and I think just one function which has multiple images; (the script now supports just one image per function). A few other problems too, I'm sure. Some of these might best be handled with changes to the original FrameMaker source rather than by addressing them in the Python script.
This is most of a major task described in the analysis and design document of 1.5 weeks ago. See:
http://cadswes2.colorado.edu/~philw/2014/RplDocDesign/project.html
FWIW, here is the Python script -- Python 3.4 using minidom (Mini DOM) XML processing.
http://cadswes2.colorado.edu/~philw/2014/RplDocDesign/PythonWork/test1/parseXml1_py.txt
-----
*Technical: These are the text replacements I applied to the HTML generated from FrameMaker. I applied these changes just using Notepad++. Either the Python minidom XML parser couldn't handle the original characters (see below), or the resulting characters just didn't display well in the final HTML.