Documentation for the AscToHTM conversion utility |
This documentation can be downloaded as part of the documentation set in .zip format (370k)
New in version 4
New in version 4 is the ability to have the program generate a set of frames from your source file. The program works to a model set of frames as shown below, but you have a great degree of control over how the frames are laid out, and what their contents are.
+------------------------------------------------------------+ | Header frame | | (optional) | +-------------+----------------------------------------------+ | NOFRAMES | | | link | | | | | | | | | | | | Contents | Main | | Frame | Frame | | (optional) | | | | | | | | | | | | | | | | | +-------------+----------------------------------------------+ | Footer frame | | (optional) | +------------------------------------------------------------+
Frames are implemented under HTML by having a document that describes the frame layout by using one or more nested <FRAMESET> tags. These tags group together <FRAME> tags that identify other HTML files that describe the contents of the individual frames or panes. The HTML page containing the <FRAMESET> doesn't normally contain any visible content. The source of this HTML page looks something like this :-
<FRAMESET ROWS="110,*,90"> <FRAME NAME="header" SRC="header.html"> <FRAMESET COLS="260,*"> <FRAME NAME="contents" SRC="contents.html"> <FRAME NAME="main" SRC="main.html"> </FRAMESET> <FRAME NAME="footer" SRC="footer.html""> <NOFRAMES> <BODY> <p>This browser does not support FRAMES<p> <p>Visit <A TARGET="_top" HREF="noframes_main.html">this link</A></p> </BODY> </NOFRAMES> </FRAMESET>
This example produces a layout similar to that shown in the diagram in 8.1. There are four frames as follows :-
- "header" at the top of the screen with content taken from the HTML page header.html
- "footer" at the bottom of the screen with content taken from the HTML page footer.html
- the two frames "contents" and "main" side by side in the middle of the screen, between the "header" and "footer" frames. The "contents" frame is on the left, the "main" frame on the right. The contents of these frames are held in the html files "contents.html" and "main.html".
The <NOFRAMES> tag describes the content to be displayed if the browser doesn't support frames. This is less common now, but is still important as many search engines don't understand frames, and will only index the pages linked to in the <NOFRAMES> tag.
In HTML the frame names and source file names can be whatever you like. AscToHTM uses the frame names "header", "footer", "contents" and "main", but will vary the source file names according to the name of your input filename.
Depending on the details of your conversion, not all of the above frames are generated, in which case the <FRAMESET> tags will look slightly different.
You don't need to worry about any of this as AscToHTM will determine what layout is required and will generate the necessary HTML <FRAMESET> code.
By default if you convert a file called "myfile.txt" the files created are named as follows:-
myfile_frame.html
- Master <FRAMESET> file
myfile_header_frame.html - "header" source file. myfile_contents_frame.html - "contents" source file. myfile_footer_frame.html
- "footer" source file.
myfile.html - "main" source file.
The "main" frame will contain the conversion of your source file. If you elect to split a document into many pages, then this will show the start page (which will have links to any next/previous page).
See also Splitting the document into many HTML pages
If your document has recognised headings, then the program is able to generate a contents list (see 5.6.2). In such cases a "contents" frame is generated and the contents list is placed in a file called "myfile_contents_frame.html".
If no contents list can be generated, then no contents frame is created unless you supply a CONTENTS_FRAME HTML fragment to be used as the contents of the "contents" frame (see 8.4)
The contents frame is placed to the left of the main frame. It will include a hyperlink labelled "NOFRAMES" (see 8.5) and the generated contents list. This is different from the <NOFRAMES> tag described in 8.2.1.
You can use policies (see 8.3) to suppress the creation of a contents frame or to control the following:-
- width of the frame
- colours of background and text
- number of levels shown in the generated contents list
- whether a "NOFRAMES" link is shown, and what URL it links to
You can also customize the frame's appearance using the following HTML fragments (see 8.4)
- CONTENTS_FRAME
- START_TOC / END_TOC
The software cannot "detect" headers and footers in your source text, so you will only get a header or footer frame if you supply the HTML yourself. Header and footer frames can be useful as they provide you with the opportunity to supply titles, navigation links or copyright notices that are always visible.
Prior to version 4 the software already had the ability to add HTML headers and footers to each page generated using HTML supplied in separate files identified by policy values. From version 4 onwards HTML fragments may also be used.
NOTE: We recommend that, where possible, you use HTML fragments to define any header and footer HTML
It's expected that you may want to convert the same source into both frames and non-frames forms, using the same policy file. Given this the program has the ability to "promote" the HTML headers and footers used in non-frames production into their own always-visible frames. Equally there may be times when this behaviour is not wanted.
The relationships between headers and footers used in non-frames conversion and those used in frames-based conversion are quite complex. In the following sections we describe how headers (footers) are calculated. The logic is described for headers, but applies equally well to footers if you make the necessary name changes.
In non-frames conversion each page created will get a HTML header if
- The policy "HTML header file" is set
- The HTML fragment HTML_HEADER is defined
If both are set, the HTML_HEADER fragment is used in preference.
The selected header is referred to as the "standard" header in the discussion in the next two sections.
- Note:
- For HTML footers the fragment HTML_FOOTER is used, and the policy
"HTML footer file" is tested.
In frames conversion the HTML header added to each page is determined by three things
- Any "standard" HTML header defined for non-frames conversion (see 8.2.4.1)
- the policy "Use main header in header frame"
- whether or not a HTML fragment MAIN_FRAME_HEADER is defined
If the fragment MAIN_FRAME_HEADER is defined, then that is used.
If the fragment MAIN_FRAME_HEADER is not defined, and there is no "standard" header, then the main frame gets no HTML header.
If the fragment MAIN_FRAME_HEADER is not defined, and the policy is not set then the "standard" header is used as in non-frames conversion.
If the fragment MAIN_FRAME_HEADER is not defined, and the policy is set then the "standard" header is promoted into its own "header" frame, and the main frame gets no HTML header.
- Note:
- For HTML footers the fragment MAIN_FRAME_FOOTER is used, and the policy
"use main footer in footer frame" is tested.
In frames conversion whether or not a "header" frame is created is determined by three things
- Any "standard" HTML header defined for non-frames conversion (see 8.2.4.1)
- the policy "Use main header in header frame"
- whether or not a HTML fragment HEADER_FRAME is defined
If the fragment HEADER_FRAME is defined, then that is used as the contents of a "header" frame.
If the fragment HEADER_FRAME is not defined, and there is no "standard" header, then no "header" frame is created.
If the fragment HEADER_FRAME is not defined, and the policy is not set, then no "header" frame is created.
If the fragment HEADER_FRAME is not defined, and the policy is set, then the "standard" header is used as the contents of the "header" frame. In other words "standard" header is promoted from the "main" frame into its own "header" frame.
- Note:
- For HTML footers the fragment FOOTER_FRAME is used, and the policy
"use main footer in footer frame" is tested.
A large number of policies influence frames generation. These are described more fully in the Policy manual.
general
"Place document in frames"
"Output frame name""New frame link window name"
"Open frame links in new window"contents frame
"Add contents frame if possible"
"Add NOFRAMES links"
"NOFRAMES link URL""Number of levels in contents frame"
"Contents Frame width"
"Contents frame background colour"
"Contents frame text colour"main frame
A number of file generation policies affect the main frame's appearance, including :-
header and footer frames
"Use main header in header frame"
"Header Frame depth"
"Header frame background colour"
"Header frame text colour""Use main footer in footer frame"
"Footer Frame depth"
"Footer frame background colour"
"Footer frame text colour"
HTML fragments were introduced in version 4 as a means of allowing users to customize some the HTML generated by the software. This feature is heavily used in frames generation.
The fragment names used in frames production includes
- HEADER_FRAME
- If defined, this fragment is used as the contents of a header frame at the top of the screen
- FOOTER_FRAME
- If defined, this fragment is used as the contents of a footer frame at the bottom of the screen
- CONTENTS_FRAME
- If defined, this fragment is used as the contents of the "contents" frame on the left of the screen. If not defined the "contents" frame will contain a generated contents list
- MAIN_FRAME_FOOTER
- If defined, this fragment is used as the HTML footer of each page that appears in the main frame, overriding any HTML_FOOTER or value defined via policy file.
- MAIN_FRAME_HEADER
- If defined, this fragment is used as the HTML header of each page that appears in the main frame, overriding any HTML_HEADER or value defined via policy file.
Other HTML fragments may have an effect. For example :-
- START_TOC
- A fragment to be output before any generated table of contents. If not defined the default behaviour is to output the title "Table of Contents"
- END_TOC
- A fragment to be output after any generated table of contents. If not defined the default behaviour is to simply put out a horizontal rule <HR>
For a fuller description of HTML fragments see the Tag manual.
There are several reasons why providing a non-frames alternative to your pages is a good idea. These include
- Not all browsers support frames. This is rarer these days, but there are still people who use text-based or non-visual browsers that can get confused by frames.
- Not all people like frames. This is understating it, as many people loathe frames. This is because frames pages are hard to bookmark and the navigation can confuse some people.
- Many search engines won't access the HTML pages used inside frames. This means your pages will go un-indexed, making it hard for people to find them.
To help with these problems the software supplies a <NOFRAMES> tag in the main <FRAMESET> document, and a visible "NOFRAMES" hyperlink in the contents frame.
The program can place a hyperlink in the contents frame. This link is labelled "NOFRAMES" and will link to the first main page. This will allow users who don't like frames to view your pages in a non-frames window. You can control this link to a limited extent using policies (see 8.3)
HTML provides a tag whose contents is displayed to any browser that doesn't support the <FRAMESET> tag. The program will automatically generate a <NOFRAMES> tag that displays a message saying the page requires frames, and offering a link to the first main page. This will allow users with non-frames browsers, and search engines to access your main pages.
You should consider whether or not your pages are suitable for both frames and non-frames viewing. If they are, then you can use the first page displayed in the main frame as your NOFRAMES hyperlink target. This is, in fact, the default behaviour.
There are a number of reasons that you might want to maintain two sets of pages :-
- You don't want to have the non-frames version split into as many small small pages as the frames version (different "Split level" policy values)
- You want to place different headers and footers on the two versions to allow for different methods of navigation.
If you do want two sets of files, simply convert the file twice with and without frames generation selected. You can either move the files into different directories, or change the output filename for one of the sets. Other than these changes you should be able to use the same policy file.
If you create two sets of files, make sure you set the "NOFRAMES link URL" policy to point to the first non-frames HTML page.
One of the reasons people dislike frames is that when they click on a hyperlink the selected page can end up being displayed inside the frame, rather that in a full window. Alternatively the selected link is displayed in a new browser window.
AscToHTM defaults to the following behaviour
- links in the "header", "footer" and "contents" frames are all displayed in the "main" frame.
- links in the "main" frame that belong to the current document (although possibly in a different HTML source file) are displayed in the "main" frame.
- links in the "main" frame that do not belong to the current document (e.g. they are to another site) may be displayed in a full browser window. You can control this behaviour using the policies
"Open frame links in new window"
"New frame link window name"The default behaviour for links in the last category is to display them in the "_top" window. The name "_top" is reserved by browsers to mean the main browser window, so in most cases clicking on a link to an external site will cause the current set of frames to be replaced by the selected page without creating any additional browser windows.
When generating frames documents the area of screen allocated to the "main" frame is necessarily smaller than the whole browser window. For his reason you may want to split your document into many, smaller pages to reduce the need for scrolling. This can work well with a contents list on the left, and is in fact the main reason people like frames as a means of navigating through a large set of information.
See File generation policies for details on the policies that may be used to split large files into a set of smaller pages all linked together.
For your convenience the Windows version of the software allows you to select a conversion type and includes a "Output HTML as a set of FRAMES" option.
If you select this option a number of policies are set for your convenience. These include
The former is set to "yes", and the latter is set to "2", which should hopefully prove a suitable default.
When this option is first selected the "Frames" properties sheet is displayed to allow you to review and edit the selected frames policies.
Converted from
a single text file by
AscToHTM © 1997-2001 John A Fotheringham |