AscToHTM 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, AscToHTM tries to read the text file and mark it up in HTML 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
During the analysis pass AscToHTM 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.
New in version 3.2
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.
During the output pass AscToHTM
- Generates HTML (there's nothing like stating the obvious)
- (optionally) creates a suite of inter-linked HTML pages
- (optionally) generates a contents list
- (optionally) generates a directory page
The HTML generated depends only on the original document, the calculated document policy, and any user policies supplied.
HTML markup produced describes the markup produced in more detail.
AscToHTM can detect the presence of a contents list in the original document. Alternatively you can choose (see 6.3.4) to have AscToHTM to generate a contents list for you, in which case any original list is omitted from the output HTML document.
Regardless of whether the original or generated contents list is used, AscToHTM will turn the contents list into hyperlinks that will take you to the correct HTML file and location.
There is a fuller discussion of contents lists in 5.6.2. The policies that influence contents list production are listed in 6.3.4, whilst the pre-processor commands are described in 7.1.3.
By default AscToHTM creates a single .HTML file. However, through file organisation document policies (see 6.3.3) it is possible to
- Split the document into a number of smaller .HTML files (see the policy "Split Level").
- Insert standard JavaScript into the <HEAD> ... </HEAD> section of each page (see also the policy "HTML script file").
- Add a HTML "header" to the top of each generated file (see also the policy "HTML header file")
- Add a navigation bar at the foot of each page with links to the Next/Previous .HTML page and the contents list (see also the policy "Add navigation bar").
- Add a HTML "footer" to the end of each generated page (see also the policy "HTML header file")
![]() |
Converted from a single text file by AscToHTM © 1997-99 John A. Fotheringham | ![]() |