Documentation for the AscToRTF conversion utility

This documentation can be downloaded as part of the documentation set in .zip format.


Prev | Next | Contents


3 How AscToRTF works

3.1 The big assumption

AscToRTF makes one big assumption :-

Each text file has been laid out in a consistent manner by its author in a way that makes it easy for a human reader to understand.

Given this, AscToRTF tries to read the text file and mark it up in RTF accordingly. This is achieved by making three passes through the document, an analysis pass (see 3.2), a collating pass (see 3.3), and an output pass (see 3.4).

Note: Sadly this assumption is not always true :(


3.2 The analysis pass

During the analysis pass AscToRTF gathers together all the statistics that it needs to analyse how the author has laid out the file.

For example, the distribution of line indentations and line lengths is observed, together with the number and types of bullets, section headings and lots of other stuff.

Once this has been done, the program uses this data to determine how the author has structured the document. For example are the section headings underlined, capitalised or numbered? If numbered, what style of numbering is used, and at what level of indentation is the heading placed?

This information is then used to set the analysis polices (see the Policy manual) which may then be overridden by the user, or by loading a policy file with different values.


3.3 The collating pass

Having performed the analysis, the program makes a second "collating" pass. This is effectively a dry run for the output pass.

During this pass the program determines how the file will be output into one or more output files and where certain key in-line tags occur.

It also assembles any contents list.

This information is then used during the output pass to reduce the likelyhood of errors, and to ensure all internal hyperlinks are valid and will point to the correct anchor point in the correct output file.


3.4 The output pass

During the output pass AscToRTF generates the RTF file (there's nothing like stating the obvious :-)

The RTF generated depends only on the original document, the calculated document policy, and any user policies supplied.

RTF produced describes the markup produced in more detail.



Prev | Next | Contents


Valid HTML 4.0! Converted from a single text file by AscToHTM
© 1997-2000 JafSoft Limited
Converted by AscToHTM