Firstly I have implemented lists for html in wvHtml, get
the latest to check it out. I have munged the lists into
as close an appromation of the original word ones, *inside*
the contraints of html, so you get a reasonable best fit.
wv/feature-examples/support-list-features.doc
is a reasonably complete list of what i believe you can do with
lists,and it converts reasonably well, as well as word does lists
anyway, I am interested in hearing about broken lists and
incorrect html output. Give a check with word's html export
first to see if there is a better strategy there for whatever
broken case you find.
Now for the list api and information about that. (of interest to
abiword)
Each paragraph may or may not be a list entry, therefore each
list entry is a single paragraph. If a paragraph is in a list
the ilfo member is set to some nonzero value, there is a ilvl
value which sets the level of the list. Up to nine levels,
numbered from 0 to 8.
Firstly in decode_simple and its counterpart decode_complex I
extract all the information we need to work with lists, i.e.
the wvGetLST and wvGetLFO_records calls, which fill in what
can only be described as a host of structures and lists.
Now given a paragraph that is a list entry you can use the
utility function wvGetListEntryInfo which fills in through
a magical set of mechanisms a final LVL structure which
contains all the information needed for that list entry.
It contains the list beginning number, and so on, look at the
wv.h or the word97 documentation to understand what is what.
There are quite a few tricky things with lists, the most
tricky is that a list can be seperated by nonlist paragraphs
or other lists, and continue counting from where it left off,
theres a member of the lvl that controls this. So to help keep
track of this, i have added a LVL arrary and a starting list
number array to the expand_data and wvParseStruct which can be
used as an aid to tracking this behavior, how you use it is up
to the implementor using wv, but a suggested use is shown in
wvConfig.c. Note that i believe that abiword will have to make sure
that the new entries to wvParseStruct don't shag things up for them,
i believe that they are ok.
For the html version most of the information in the lvl structure
is unusable, but what is in there for a more complete implementation
is...
the number to use,
the text before and after the number i.e. a bracket
some paragraph sprms which modify the paragraph that is the list entry
some character sprms which modify the character run that is the list
number string.
When someone (such as abiword) implements list in their binding to wv,
I can help out to work out more api calls of use, and work on any
bugs or imperfections that might exists. Has abiword got lists as of
yet, what is the state of the art in the abi world for these ??
Finally, I am aware that lists are handled much differently in word 6
that word97, and i am unaware of which model word 95 uses as of yet.
So i would request some documents with simple lists from both those
word processors, note *not* word 97 files saved with word97 as
word 6/95 as that usually saves the document as rtf, and are a different
case entirely. Again you can use wvSummary to determine if a word doc
is 97/95 or 6.
This list code is alpha and I would not be surprised to find that it breaks
terribly. And i will be verifying it with ever more insane lists, but to
let you know how things are at the moment im releasing this one.
Also for this release, each wvHtml file by default will output at the end
of the html a link to the w3c validator. And im going to try and stick to
valid html ala DTD HTML 4.0 Transitional
Comments and bug fixes are always welcome.
C.
Real Life: Caolan McNamara * Doing: MSc in HCI
Work: Caolan.McNamara@ul.ie * Phone: +353-86-8790257
URL: http://www.csn.ul.ie/~caolan * Sig: an oblique strategy
Tust in the you of now