>2' 3 : How AscToHTM works  A 8
AscToHTM 

Documentation for the OAscToHTM conversion utility



9

This documentation can be downloaded as part of the  documentation set in .zip format (370k)




V Previous page $@ Back to Contents List#R Next page 


 (

3 How AscToHTM works

 !

3.1 The big assumption

-

AscToHTM makes one big assumption :-


F

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.


G

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

L

Note: Sadly this assumption is not always true




3.2 The analysis pass

J

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

H

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

I

Once this has been done, the program uses this data to determine theE rules used by the author in structured their document. For exampleC are the section headings underlined, capitalised or numbered? IfG numbered, what style of numbering is used, and by how many characters' is each type of heading indented?

G

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


 !

3.3 The collating pass

J

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

H

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

-

It also assembles any contents list.

G

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


 

3.4 The output pass

(

During the output pass AscToHTM

 

and (optionally)


 

3.4.1 Generating HTML

"

The HTML generated depends on

 r

HTML markup produced describes the markup produced in more detail.


 )

3.4.2 Generating a contents list

J

AscToHTM can detect the presence of a (numbered) contents list in the€ original document. Alternatively you can choose (see Contents generation policies)I to have AscToHTM to generate a contents list for you, in which case any= original list is omitted from the output HTML document.

K

Regardless of whether the original or generated contents list is used,E AscToHTM will turn the contents list into hyperlinks that will take0 you to the correct HTML file and location.

m

There is a fuller discussion of contents lists. The policies€ that influence contents list production are listed in Contents generation policies,j whilst the pre-processor commands are described in 7.1.3.


 :

3.4.3 Splitting the document into many HTML pages

L

By default AscToHTM creates a single .HTML file. However, through filej organisation document policies (see File generation policies) it is possible to


    
  1. @ Split the document into a number of smaller .HTML files (seeN the policy "Split Level").

  2. 
  3. Q Insert standard JavaScript into the <HEAD> ... </HEAD> section ofl each page (see also the policy "HTML script file").

  4. 
  5. G Add a HTML "header" to the top of each generated file (see also theS policy "HTML header file")

  6. 
  7. C Add a navigation bar at the foot of each page with links to the@ Next/Previous .HTML page and the contents list (see also theX policy "Add navigation bar").

  8. 
  9. G Add a HTML "footer" to the end of each generated page (see also theS policy "HTML header file")
  10. 
 )

3.4.4 Generating a set of FRAMES

*

New in version 4

I

AscToHTM can place the HTML into a set of FRAMES. This is describedK fully in the chapter on Frames


 8

3.4.5 Generating HTML for the Windows clipboard

*

New in version 4

J

The Windows version of the software can place the HTML generated intoC the clipboard, rather than outputting it into a file. This makesF it easier to paste the HTML into another application (such as a HTMLJ editor). When this code of conversion is selected, the <HEAD> and4 <BODY> tags are omitted from the output.

G

The use of the clipboard is made even more powerful if a clipboard… extender such as ClipMate is used. See http://www.jafsoft.com/clipmate.html


 2


V Previous page $@ Back to Contents List#R Next page 


B& 
Valid HTML 4.0!Converted from 6 a single text file by A AscToHTM
J© 1997-2001 John A Fotheringham