$_$_CHANGE_POLICY Document author : John A Fotheringham $_$_CHANGE_POLICY Document Subject : Tag Manual for JafSoft text conversion utilities $_$_CHANGE_POLICY Document Company name : JafSoft Limited $_$_TITLE Tag Manual for JafSoft text conversion utilities $_$_CHANGE_POLICY Highlight Definition Text : Yes $_$_CHANGE_POLICY Bullet Char : '-' $_$_CHANGE_POLICY Minimum TABLE column separation : 2 $_$_CHANGE_POLICY Default TABLE Header cols : 1 $_$_CHANGE_POLICY Default TABLE Border size : 0 $_$_CHANGE_POLICY Default TABLE cell padding : 2 $_$_CHANGE_POLICY Cross-refs at level : 1 $_$_CHANGE_POLICY Preserve underlining of headings : no $_$_DEFINE_HTML_FRAGMENT HTML_HEADER

The "Tag Manual" for JafSoft's text conversion utilities

The most recent version of this document can always be found online


$_$_END_BLOCK $_$_DEFINE_HTML_FRAGMENT HTML_FOOTER
Valid HTML 4.0! Converted from a single text file by AscToHTM
© 1997-2004 John A. Fotheringham
Converted by AscToHTM
$_$_END_BLOCK This file was generated by [[VERSION]] from this [[SOURCE_FILE]] on [[TIMESTAMP]] $_$_CONTENTS_LIST 1 Introduction [JafSoft] have produced the following programs - [AscToHTM] converts plain text files into HTML files - [AscToRTF] converts plain text files into RTF files These programs share the same text analysis engine, and should do a good job of understanding the structure of the text document and replicating it in the target format. However frequently users will want to have control over how the output looks and occasionally the text analysis will go wrong. For that reason the software supports - a large number of configuration options that act as rules or "policies". These policies may be saved in an external file called a policy file, so that the same combination of policies can be re-loaded. The use of policies is described fully in the [Policy Manual]. - The addition of special tags to the source file which tell the program's "pre-processor" how to process the file. This document describes the tagging system that the software supports. 1.1 Overview of the pre-processor During the analysis process the software reads the source files line-by-line. The pre-processor recognises special keywords in two ways :- *Directives* "Directives" consist of a single line in the source file beginning with the string "$_$_" followed by a recognised keyword and any additional "attributes" that the directive supports. *In-line tags* In-line tags, as the name implies, can occur anywhere in the source lines. They are enclosed between the special strings "[[OT]]" and "[[CT]]". Between these strings the tag consists of a keyword and then any attributes that tag supports. In both cases the tag or directive cannot be split over multiple lines, that is directives must be on a line by themselves, and in-line tags must be wholly contained on a single line. Examples of a directive and in-line tags are shown below. $_$_BEGIN_PRE $_$_LINERULE 75% The BR tag means this text will be broken [[OT]]BR[[CT]] into two lines. $_$_END_PRE becomes :- $_$_LINERULE 75% The BR tag means this text will be broken [[BR]] into two lines. Some tags can be expressed in either directive or in-line form. 1.2 Directives Directives exist on a line by themselves in the source text. They have the form $_$_ where the "$_$_" must occur at the start of the line and the must be recognised. If the "$_$_" is not at the start of the line, the directive is ignored and treated as end-user text. This device has been used to date to aid conversion of the software's own documentation to HTML and Windows Help files. The format of the depends on the particular tag, but a general description is given in 1.4. 1.3 In-line tags In-line tags may occur anywhere within end-user text, but *not* on directive lines or inside other in-line tags. In-line tags have the form [[OT]] [[CT]] that is the and its are between "[[OT]]" and "[[CT]]" delimiters. Initially the start and end delimiters must lie on the same line of the source text. The must be recognised, even if the tag is not yet fully implemented. Note, the delimiters "[[OT]]" and "[[CT]]" are themselves dynamically configurable. The format of the depends on the particular tag, but a general description is given in 1.4. 1.4 Tag attribute lists The should be a comma-delimited set of attribute values. The number and types of attributes expected will depend on the tag concerned. Some tags allow attributes to be optionally omitted, and a default value used instead. If the attribute being omitted is not the last on the list, then a place-saving comma should be supplied. Examples TAG 1,2,3,4 // full list TAG 1,,3,4 // argument 2 is missing TAG 1,,3, // arguments 2 and 4 are missing TAG 1,,3 // arguments 2 and 4 are missing TAG 1 // arguments 2, 3 and 4 are missing If a *mandatory* argument is missing (one for which no default value is permitted), a TAG_ERROR will be signalled. Each attribute in the list will be of a particular type. Supported types are - numeric values (mostly integers) - strings (enclosed in quotes (see below) - coded lists... e.g. an alignment attribute can take the values 'L' for Left, 'R' for Right etc. If a particular attribute value is incorrect for the expected type, then a TAG_ERROR will be signalled. String attributes should be be placed in quotes if they contain commas themselves. It's probably good practice to place them in quotes in any case. Quotes within string attributes should be doubled up e.g. "This string has the word ""quotes"" in quotes" becomes This string has the word "quotes" in quotes Here are some examples TAG 1,2 // arg 1 is '1', arg 2 is '2' TAG ,2 // arg 1 is missing, arg 2 is '2' TAG "one",2 // arg 1 is 'one', arg 2 is '2' TAG "say one",2 // arg 1 is 'say one', arg 2 is '2' TAG "a,b", 2 // arg 1 is 'a,b', arg 2 is '2' TAG "say ""one"""", 2 // arg 1 is 'say "one"', arg 2 is '2' TAG // both arguments missing, defaults will be used TAG , // both arguments missing, defaults will be used TAG ,, // both arguments missing, defaults will be used 1.5 Error handling 1.5.1 Unrecognised and unimplemented tags Unrecognised and unimplemented tags will be signalled via messages. These messages will be given different severities. The software allows messages to be filtered by severity and type, so in this way the testing and production versions of the software can be made to report differently. 1.5.2 Parse errors All failures to fully parse a tag will be reported. The actual error recovery (if any) will vary on a tag-by-tag basis. Usually the tag will simply be ignored, removed from the end-user text and signalled as in error. Occasionally a certain default behaviour may be possible. For example, a failure to fully parse the attribute list of a LINERULE tag would probably default to outputting a simple
into the HTML, rather than completely ignoring the LINERULE request. 1.6 Tagging restrictions - Most tags are either directives or in-line tags. Only a few may be used as either. - The tag must be wholly contained on a single line in the source file. Directives must be on a line by themselves. You can have multiple in-line tags on one line, but no single in-line tag may be spread over multiple lines. - Nested in-line tags are not allowed 2. Using the pre-processor The preprocessor was originally introduced to allow users more flexibility in the HTML they generate. The pre-processor allows [AscToHTM] and [AscToRTF] to be used as an authoring tools, as opposed to a simple text conversion or migration tool. Preprocessor lines are not normally output to the HTML or RTF generated. Instead they are used to modify the conversion process in a number of ways. 2.1 Marking up sections of text The pre-processor can be used to mark sections in your document so that the program will correctly process them as you wish. Note: The software does attempt to spot much user-formatted text automatically, but this is a difficult area and prone to error. Hence the use of these directives can reduce the error rate on such occasions. Examples include :- *[[POPUP SECTION]]* This directive is used to divide the document up into named sections that may then be conditionally included/excluded from a particular conversion. *[[POPUP BEGIN/END_TABLE]]* [[BR]] *[[POPUP BEGIN/END_DELIMITED_TABLE]]* [[BR]] *[[POPUP BEGIN/END_COMMA_DELIMITED_TABLE]]* [[BR]] *[[POPUP BEGIN/END_USER_TABLE]]* *New function* These pairs of directives are used to bracket tables of various types in the source text. The software will attempt to detect plain text tables, but if this goes wrong adding these commands can correct the analysis Within these tables you can use other TABLE pre-processor commands to tailor the HTML generated (see "[[GOTO The TABLE commands]]"). *[[POPUP BEGIN/END_CONTENTS]]* Used to mark up a contents list in the source document. The software will attempt to automatically detect the presence and location of any contents list in the document, but the algorithm can be problematic, and only really works for numbered headings. *[[POPUP BEGIN/END_HTML]]* Delimits a section of raw HTML code to be copied to the output file unchanged. *[[POPUP BEGIN/END_CODE]]* [[BR]] *[[POPUP BEGIN/END_DIAGRAM]]* [[BR]] *[[POPUP BEGIN/END_PRE]]* Delimits sections of pre-formatted text. CODE refers to software samples whilst DIAGRAM refers to ASCII art. PRE is the more general "pre-formatted" text, although currently all 3 have the same implementation. *[[POPUP BEGIN/END_IGNORE]]* Delimits text that should be ignored. This could be anything from comments to copyright statements in the original source file that shouldn't appear in the converted document. 2.2 Commands that influence the indexing of the document Certain directives can be used to alter the document properties. Often these affect how the document will be searched and indexed. In HTML these mostly lead to tags in the .. of each page. Often these tags produce no visible effect. In RTF these lead to field in the document properties being filled in. Examples include :- *[[POPUP TITLE]]* [[BR]] *[[POPUP DESCRIPTION]]* [[BR]] *[[POPUP KEYWORDS]]* [[BR]] *[[POPUP STYLE_SHEET]]* (HTML Only) The DESCRIPTION and KEYWORDS commands may be continued on subsequent lines provided they also begin with the same $_$_ directive. 2.3 Useful one-line pre-processor commands A large number of one-line directives exist. Those for tables are listed the section on [[GOTO The TABLE commands]]. Others include *[[POPUP CONTENTS_LIST]]* [[BR]] *[[POPUP HTML_LINE]]* [[BR]] *[[POPUP INCLUDE]]* [[BR]] *[[POPUP LINERULE]]* [[BR]] *[[POPUP NAVIGATION_BAR]]* [[BR]] *[[POPUP TOC]]* 2.4 Useful in-line tags A large number of in-line tags are available. These can be used to produce a number of useful effects. They include :- *[[POPUP BR (line break)]]* [[BR]] *[[POPUP GOTO]]* [[BR]] *[[POPUP HYPERLINK]]* [[BR]] *[[POPUP TIMESTAMP]]* [[BR]] *[[POPUP SPACES]]* [[BR]] *[[POPUP SUPER and SUB]]* [[BR]] *[[POPUP VARIABLE]]* 2.5 The TABLE commands These directives are used to tailor the HTML generated in any tables the software creates. They are placed either _At the top of the file_ [[BR]] Directives placed here become defaults for the whole file, and will replace any policies that have been set (see the section on "Table Generation" in the AscToHTM manual) _Inside a BEGIN_TABLE ... END_TABLE section_ [[BR]] Directives placed here will apply only to the table marked up by these commands (see 7.1.2). The table commands are described (naturally enough) in the following table. $_$_BEGIN_DELIMITED_TABLE $_$_TABLE_BORDER 0 $_$_TABLE_ALIGN CENTER $_$_TABLE_CELLSPACING 2 Directive Value Effect -------------------------------------------------------------------------------- [[POPUP TABLE_ALIGN]] Align Specifies the alignment of the whole table. [[POPUP TABLE_BGCOLOR]] Colour Colour of background [[POPUP TABLE_BORDER]] Number Size of border. 0 = None [[POPUP TABLE_BORDERCOLOR]] Colour Colour of border [[POPUP TABLE_CAPTION]] Text Table caption. Added centred at the top [[POPUP TABLE_CELL_ALIGN]] Align Specifies the default alignment of cells. Left, right or center [[POPUP TABLE_CELLSPACING]] Number Spacing between cells. [[POPUP TABLE_CELLPADDING]] Number Padding inside each cell [[POPUP TABLE_COLO(U)R_ROWS]] (none) If present this specifies that the odd and even rows of the table should be coloured differently. See also the [[HYPERLINK POLICY,"Colour data rows"]] policy. [[POPUP TABLE_CONVERT_XREFS]] (none) If present, indicates that any section cross-references in the table may be converted to hyperlinks (see also the policy line [[HYPERLINK POLICY,"Convert TABLE X-refs to links"]]) [[POPUP TABLE_EVEN_ROW_COLO(U)R]] Colour When data rows are to be coloured this specifies the colour of the even numbered rows. [[POPUP TABLE_HEADER_ROWS]] Number Number of header rows. These will be placed in .. markup [[POPUP TABLE_HEADER_COLS]] Number Number of header columns. These will be marked up in bold [[POPUP TABLE_IGNORE_HEADER]] (none) If present, indicates that the first few line (i.e. the header) should be ignored when calculating the column structure of the table. See also policy [[HYPERLINK POLICY,"Ignore table header during analysis"]] [[POPUP TABLE_LAYOUT]] Layout Explicit structure of table in terms of number of columns and their widths. See also policy [[HYPERLINK POLICY,"Default TABLE layout"]] [[POPUP TABLE_MAY_BE_SPARSE]] (none) If present, indicates that the TABLE may be sparse (see also the policy [[HYPERLINK POLICY,"Expect sparse tables"]]) [[POPUP TABLE_MIN_COLUMN_SEPARATION]] Number Number of spaces to be taken as a column separator when analysing the table (see also the policy [[HYPERLINK POLICY,"Minimum TABLE column separation"]]). [[POPUP TABLE_ODD_ROW_COLO(U)R]] Colour When data rows are to be coloured this specifies the colour of the odd numbered rows. [[POPUP TABLE_WIDTH]] Text The width of the table (see also the policy [[HYPERLINK POLICY,"Default TABLE width"]]) $_$_END_DELIMITED_TABLE Colours should be [[GOTO HTML Colours]] which will placed in the various attributes of the tag and other. The program simply transcribes your value into the output file. 2.6 The CHANGE_POLICY command NOTE: This feature has the potential to cause mayhem, and as such is offered to users on a "as is" basis. That is, we offer no support for getting this feature to have the effect a user may desire. This directive allows you change a particular policy in part of a document. This is a potentially powerful feature, allowing you to tailor the conversion of your file *in different sections of that file*, or to embed the policy particular to a file in commands inserted at the top of the file itself. The syntax of the command line is $_$_CHANGE_POLICY where is a policy line as it would appear in a policy file, and (usually) as it appears in the [Policy Manual]. For example the following would all be valid directives $_$_BEGIN_PRE $_$_CHANGE_POLICY Background Colour : red $_$_CHANGE_POLICY Ignore multiple blank lines : Yes $_$_END_PRE Although how and when they would take affect will depend on the policy. For example, the background colour would only take effect if splitting the file up, and only on the next file generation. This works, BTW, so if anyone wants to split a file into many pages, all different colours, then be my guest. There are a *many* caveats to this behaviour :- - *not all policies are supported* Not all policies may be changed in this way. In particular policies that open other policy files are not supported. Even if a policy if "changed", it does not follow that changing the policy will have an effect. - *analysis policies* It is unlikely that this feature can be sensibly used to influence the analysis of file, other than when placed at the top of the file only. If such a manner it is simply an alternative to using a separate policy file. - *output policies* Output policies are referenced at different times. Only those that are referenced *after* the line is read from the source file may be influenced, thus things like output file name may have no effect. - *toggleable policies* Not all policies once changed, can be changed back. This is particularly of policies that contain values to be added to a list. This is an issue that may be addresses in later versions. - *unpredictable behaviour* Messing with policies can cause unpredictable behaviour. For example if you alter the section splitting parameters, then the chances of a section cross-reference elsewhere in the document being calculated as a correct hyperlink diminishes. *That's why this feature is offered UNSUPPORTED* - *readahead buffer* To further complicate matters, the software uses a readahead, write behind buffer which means that you may need to experiment with the placing of your policy change to within 40 lines (the size of the buffer). This problem is alleviated since version [[TEXT 3.2]]. 2.7 Definition blocks and variables Using pre-processor tags you can define "blocks" of text known as "definition blocks". Definition blocks allow blocks of output to be defined out of sequence, that is the content is defined in one location, and then may be instantiated at a number of different locations. A definition block has the form $_$_BEGIN_PRE $_$_DEFINE_BLOCK .. text that forms the block .. $_$_END_BLOCK $_$_END_PRE The text inside the block may contain in-line tags, but it cannot contain any other tag directives. To invoke a block use the [[POPUP EMBED_BLOCK]] or [[POPUP INSERT_BLOCK]] commands. One tag that is particularly useful inside blocks is the [[POPUP VARIABLE]] tag. You can define variables throughout the document and then quote them inside a define block. A possible example of use would be the addition of "page" footers. You could define the text that goes inside a page footer, and include in it a variable called PAGE_NUMBER. You can then re-define the PAGE_NUMBER and output a new page boundary with the commands $_$_BEGIN_PRE $_$_DEFINE_VARIABLE PAGE_NUMBER 21 $_$_INSERT_BLOCK PAGE_FOOTER $_$_END_PRE having previously defined a PAGE_FOOTER block. It should perhaps be pointed out that "pages" are anathema to HTML, but should you want this feature this is a possible implementation. 2.8 HTML colours Some tags accept colour values. These values should be HTML colours which - for example - may be placed in the various attributes of the tag. You can enter any value acceptable to HTML. Normally a value is expressed as a 6-digit hexadecimal value in the range 000000 (black) to FFFFFF (white), but certain colours such as "white", "blue", "red" etc may also be recognised by HTML. The software (AscToHTM) simply transcribes your value into the output file. The list of colours recognised in the HTML standard is $_$_BEGIN_TABLE $_$_TABLE_HEADER_COLS 0 $_$_TABLE_BORDER 1 $_$_TABLE_ALIGN C Colour HTML Hex value -------------------------- Black #000000 Silver #C0C0C0 Gray #808080 White #FFFFFF Maroon #800000 Red #FF0000 Purple #800080 Fuchia #FF00FF Green #008000 Lime #00FF00 Olive #808000 Yellow #FFFF00 Navy #000080 Blue #0000FF Teal #008080 Aqua #00FFFF $_$_END_TABLE Only these values will be converted by the software to the equivalent names. Other names exist outside the standard which may not be universally supported. 2.9 English/American spellings As far as possible tags support both British English and American English spellings. This mainly occurs with the word "colour" (or "color"), so for example the directives $_$_TABLE_ODD_ROW_COLOUR .... and $_$_TABLE_ODD_ROW_COLOR .... are equivalent. 3 Using HTML fragments 3.1 Overview _HTML fragments only apply to HTML generation (obviously)_ The "HTML fragments" feature allows you to define a block of HTML that you can then embed in your document at key locations. These fragments are pure HTML that gets transcribed into the output files, but they may contain [[GOTO "fragment tags"]] that will be replaced by suitable values each time the fragment is used. Most fragments use reserved names, that is they have a particular meaning to the program. If you define fragments with these names they will be used instead of the HTML that is generated by default. Currently only fragments with reserved names are used by the software. The ability to define and use your own fragments names may be added in later versions of the software. You can choose to define empty fragments. This can be done either by literally defining a fragment with no HTML in it, or by issuing a RESET_HTML_FRAGMENT command - see [[POPUP "DEFINE_HTML_FRAGMENT and RESET_HTML_FRAGMENT"]] If an empty HTML fragment is defined then no HTML will be generated. If the fragment name is a reserved name then the result is to suppress that particular feature. For example the command $_$_RESET_HTML_FRAGMENT NAVBAR_TOP would cause the navigation bar at the top of each page to be suppressed when splitting large documents into several small pages. HTML fragments may be defined either in the source text, or in a separate "HTML fragments file". This file may then be selected via the policy [[HYPERLINK POLICY,"HTML fragments file"]]. Only the fragments themselves will be read from this file, everything else will be ignored, leaving you free to add your own comments to this file between the fragment definitions. If you don't want to set the policy you can get the same effect by using the [[POPUP INCLUDE]] command as follows $_$_INCLUDE to your source file near the top. This will copy the fragments file into your source text, so in this case you should include no other text in this file as it will appear in the output. You may, if you wish, re-define the HTML fragment later in the file. This will take effect from that point onwards. For example if you redefine the HORIZONTAL_RULE fragment to be an image, you could arrange for this image to change for different sections of your document. 3.2 How to define a HTML fragment Simply use pre-processor commands as follows $_$_BEGIN_PRE $_$_DEFINE_HTML_FRAGMENT ... ... ... $_$_END_BLOCK $_$_END_PRE For example, $_$_BEGIN_PRE $_$_DEFINE_HTML_FRAGMENT NAVBAR_BOTTOM $_$_END_BLOCK $_$_END_PRE could define a navigation bar for the bottom of each page which adds a hyperlink to the previous and next page which is added to some .gif. The [[GOTO fragment tags]] [[OT]]PREV_PAGE[[CT]] and [[OT]]NEXT_PAGE[[CT]] will be replaced by the correct URLs. $_$_BEGIN_PRE $_$_RESET_HTML_FRAGMENT NAVBAR_TOP $_$_END_PRE or $_$_BEGIN_PRE $_$_DEFINE_HTML_FRAGMENT NAVBAR_TOP $_$_END_BLOCK $_$_END_PRE both define an "empty" top navigation bar, thereby suppressing the generation of a navigation bar at the top of each page. 3.3 Fragment tags Within HTML fragments special "fragment tags" are supported. These tags have the same overall format as the more general pre-processor tags, but are only supported inside HTML fragments. The following tags are supported 3.3.1 Tags for navigation bar fragments $_$_BEGIN_TABLE Tag Description ========================================================================= PREV_PAGE URL of previous page. If no pervious page then URL of *this* page CURRENT_PAGE URL of the current page. Can be useful if you want to construct a NOFRAMES link to the current page. NEXT_PAGE URL of next page. If no next page then the URL of *this* page. CONTENTS_TOP URL of page containing contents list CONTENTS_NEXT_SECTION As above - but linked to an anchor for the next section in the contents list. $_$_END_TABLE 3.3.2 Tags for horizontal rule fragments $_$_BEGIN_TABLE Tag Description ========================================================================= RULEWIDTHPC The calculated ruler width expressed as a percentage. Often the program will detect a line, and will set it as a
tag of the appropriate percentage width. This is that value. RULEWIDTH The calculated ruler width. This will be the percentage width expressed for a default 800 pixel wide screen. RULEHEIGHT The ruler height. Not usually varied unless supplied as part of a [[POPUP LINERULE]] tag. RULEALIGN The ruler alignment. This may sometimes be set to LEFT if a less that 100% rule is being generated, or it may be set to some other value by a user-supplied [[POPUP LINERULE]] tag. $_$_END_TABLE The above values are all supplied ready to be used as attribute values. As such they should normally be enclosed in quotes in your HTML fragment. If you're using an tag and want to capture the width, use the RULEWIDTH value. If you're generating an
tag we recommend the RULEWIDTHPC percentage value instead. 3.3.3 Tags for frame fragments *New function* Currently there is only one fragment tag used inside frames fragments :- NOFRAMES_URL This is the URL used by default for any NOFRAMES link. Typically you'd use this inside a NOFRAMES_LINK fragment to link to the same URL as the default NOFRAMES link would, while adding your own text and decoration for the link. 3.3.4 Tags for Heading fragments *New function* The following tags may be used inside the various Heading tag fragments HEADER_TEXT The text part of the heading HEADER_LEVEL The heading level (1,2,3...). Note, this is the *logical* heading level. The default markup might use a different tag because these values are limited in range to ensure text is a sensible size (

is too big,

is too small etc). 3.3.5 Tags for Table of Contents fragments *New function* The following tags may be used inside the various TOC line tag fragments TOC_TEXT The text part of the TOC line TOC_LEVEL The TOC level (1,2,3...) TOC_URL The URL for this TOC line 3.4 Reserved HTML fragment names Here are the reserved HTML fragment names recognised by the software, and their effect on the HTML generated. 3.4.1 Navigation bar fragments $_$_BEGIN_TABLE NAVBAR_TOP_FIRST The navigation bars output at the top of the NAVBAR_TOP first, general or last pages. Usually the first and NAVBAR_TOP_LAST last navigation bars may wish to omit the previous or next links (since no such page exists). If the "_FIRST" and "_LAST" fragments are not defined, the "NAVBAR_TOP" fragment will be used instead. NAVBAR_MIDDLE Any navigation bar output in the middle of a page as a result of a [[POPUP NAVIGATION_BAR]] tag. NAVBAR_BOTTOM_FIRST As for the "NAVBAR_TOP" fragments, but this time NAVBAR_BOTTOM at the bottom of generated pages. NAVBAR_BOTTOM_LAST $_$_END_TABLE 3.4.2 The Horizontal rule fragment HORIZONTAL_RULE The horizontal ruler. Normally this is just
, but you can change that by defining a HTML fragment of this name, e.g. to use an tag (see [[GOTO A sample HTML fragments file]]). 3.4.3 Table of contents fragments *Updated in version [[TEXT 4.2]]* These fragments can be used to tailor the appearance of a generated contents list. 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
TOC_LINE_ A fragment to be output for TOC contents lines at heading level ( = 1,2,3...) TOC_LINE The default fragment to be used for TOC content lines if the specific fragment TOC_LINE_ is not defined When create TOC_LINE fragments, you will almost certainly want to use the TOC_TEXT and TOC_URL fragment tags (see [[POPUP Tags for Table of Contents fragments]]). 3.4.4 HTML headers, footers and JavaScript fragments The program previously supported the insertion of HTML at the start and end of each HTML page generated through the policies [[HYPERLINK POLICY,"HTML header file"]] [[HYPERLINK POLICY,"HTML footer file"]] [[HYPERLINK POLICY,"HTML script file"]] The new fragments HTML_HEADER, HTML_FOOTER and HEAD_SCRIPT provide exactly the same functionality. The use of fragments is encouraged over that of the previous policies, so where both are defined, the fragment will be used (e.g. a HTML_HEADER fragment will override a "HTML header file" policy value). 3.4.5 HTML header and footers (inside FRAMES) fragments A number of fragments can be used to control the creation of header and footer FRAMES, and the creation of headers and footers inside the main frame. The use of these fragments depends on the values of the policies [[HYPERLINK POLICY,"Use main header in header frame"]] [[HYPERLINK POLICY,"Use main footer in footer frame"]] which can be used to promote a HTML header/footer from the top of each HTML page into a frame by itself. This allows the same policy file to be used to generate a non-FRAMES set of pages with headers and footers on each page, and also a FRAMES set of pages with the same headers and footers now permanently on display in their own frames at the top and bottom of the screen. The following fragments can be used to define the contents of particular frames :- HEADER_FRAME If defined, this fragment will be used as the contents of a header frame at the top of the screen FOOTER_FRAME If defined, this fragment will be used as the contents of a footer frame at the bottom of the screen NOFRAMES_LINK If defined, this fragment will be used in place of any NOFRAMES link that is created by default. You would most likely use this with the NOFRAMES_URL fragment tag to define alternative text on the link. CONTENTS_FRAME If defined, this fragment will be 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 will be used as the HTML footer of each page that appears in the main frame. If defined this will override any HTML_FOOTER fragment, or value defined via policy file. MAIN_FRAME_HEADER If defined, this fragment will be used as the HTML header of each page that appears in the main frame. If defined this will override any HTML_HEADER fragment, or value defined via policy file. 3.4.6 Heading fragments *New function* Where headings are detected in the program, you can use the following HTML fragments HTML_HEADER_LINE_ The fragment to be used for headings of level ( = 1, 2 3...) HTML_HEADER_LINE The default fragment to be used for headings if there isn't a specific HTML_HEADR_LINE_ for the value of involved. The default markup would be to place the heading text in tags. Using the [[POPUP Tags for Heading fragments]] you could reproduce this in your own fragments as follows [[OT]]HEADER_TEXT[[CT]] e.g. if the heading was "Introduction" and this was a level 1 heading, this would become

Introduction

3.5 A sample HTML fragments file The following sample fragments file does the following - Defines a HORIZONTAL_RULE fragment to use an image in place of the
tag. The image uses the HTML fragment tags RULEALIGN and RULEWIDTH to take on the necessary alignment and size. - Defines a HEADER_FRAME that contains a title and link to the home page, both centred on the page. This fragment will only be used when generating a set of FRAMES. - Does a reset on the NAVBAR_BOTTOM fragment. This effectively defines an empty fragment whose effect is to suppress the navigation bar usually put at the bottom of each page when splitting a large file into sections. $_$_BEGIN_PRE !----- sample HTML fragments file Comments in this file (like these) are ignored if the file is selected via the "HTML fragments file" policy. !----- Horizontal rules ! Here's a redefinition of the horizontal rules
that the program generates. ! I'm replacing them by an image, but I'm capturing the (pixel) width and fixing ! the height (otherwise the image would scale). ! ! Within this fragment I'm using the [[OT]]RULEALIGN[[CT]] and [[OT]]RULEWIDTH[[CT]] HTML ! fragment tags to pick up the alignment and width appropriate for the rule ! when the fragment is used. ! ! NOTE, not all
tags created by the program are currently overridden in ! this way. $_$_DEFINE_HTML_FRAGMENT HORIZONTAL_RULE

$_$_END_BLOCK !----- Frame headers $_$_DEFINE_HTML_FRAGMENT HEADER_FRAME
$_$_END_BLOCK !----- bottom navigation bars ! I don't want any bottom navigation bars so issue a reset command. ! I could just as easily have defined an "empty" fragment $_$_RESET_HTML_FRAGMENT NAVBAR_BOTTOM $_$_END_PRE The HTML fragments file used on this document is html_fragments.inc 4 Complete TAG list ALLOW and DISALLOW ================== Type: Directive Description: Toggles on and off various analysis possibilities Applies to: Analysis. See policy: (none) *New function* Syntax: $_$_BEGIN_PRE ALLOW DISALLOW $_$_END_PRE The software will automatically try to detect various typographical features. You can turn this behaviour on and off in different sections by using the ALLOW and DISALLOW commands. This can be used, for example, to prevent a numbered list being wrongly detected as a numbered heading and vice versa. The recognised keywords are as follows $_$_BEGIN_TABLE Headings This enables/disable the search for lines that could be treated as headings. Lists This enables/disables the search for lines that could be regarded as list items (either unordered bullets, or alphabetic or numeric list points) All Set (enable) all of the above Reset Reset (disable) all of the above $_$_END_TABLE In each case the tag will simply add or subtract from the current list of allowable features. To aid control, two special keywords "all" and "reset" are available for inclusion in the list. "Reset" will disable all options, thus $_$_BEGIN_PRE $_$_ALLOW reset, Headings $_$_END_PRE will have the effect of disabling everything (the "reset") and then adding "Headings" to the allowed list. In this respect "ALLOW all" and "DISALLOW reset" are identical commands. Below is an example in which the DISALLOW tag is used to prevent numbered lines being regarded as lists or headings. The ALLOW tag at the end switched back to default behaviour,, so if there are any lists of numbered headings elsewhere in the document they will still be detected. $_$_BEGIN_PRE $_$_DISALLOW headings ... 1. Whatever this line is, it isn't a heading ... $_$_DISALLOW headings,lists ... 2. Whatever this line is, it isn't a heading *or* a list item ... $_$_ALLOW reset ... 3. This *may* be interpretted as either a heading or list item ... $_$_END_PRE BASEHREF ======== Type: Directive Description: Specifies URL that is used to resolve relative URLs Applies to: Hyperlinks. HTML only See policy: [[HYPERLINK POLICY,"Document Base URL"]] Syntax: $_$_BEGIN_PRE $_$_BASEHREF $_$_END_PRE _Ignored in RTF conversions_ In HTML the URL is added to a BASE tag inserted into the section of the output page(s) as follows :- This tag is used to specify the base URL against which all relative URLs should be resolved. You might want to use this if you are going to copy the page to a mirror location, but not copy the pages referred to in the relative links. The presence of a BASEHREF pre-processor command overrides any base URL specified via a [[HYPERLINK POLICY,"Document base URL"]] policy line. BEGIN/END_ASCII =============== Type: Directive Description: Delimits a section of text to appear in any "de-tagged" text Applies to: All (ignored) See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_ASCII ... (text to be shown only in de-tagged ASCII) ... $_$_END_ASCII $_$_END_PRE This markup can be used to delimit a section of text that will be ignored when converting to HTML or RTF, but to be included whenever a "de-tagged" version of the source file is produced. The de-tag utility creates a plain text version of the source file, e.g. for posting on Usenet. This tag allows authors to supply an alternative in the text file something that might be generated during HTML generation. For example the sequence $_$_BEGIN_PRE $_$_CONTENTS_LIST $_$_BEGIN_ASCII ... hand-written contents list ... $_$_END_ASCII $_$_END_PRE would allow a generated contents list to be placed in the HTML version, but a hand-written contents list to appear in its place in the text version. BEGIN/END_CODE ============== Type: Directive Description: Delimits the start and end of a code sample. Applies to: Text analysis See policy: [[HYPERLINK POLICY,"Expect code samples"]] Syntax: $_$_BEGIN_PRE $_$_BEGIN_CODE ... (lines of code) ... $_$_END_CODE $_$_END_PRE The BEGIN_CODE ... END_CODE directives are used to bracket a piece of sample code in the source text. In HTML this will either be rendered in
 ... 
markup or ... markup (see the discussion about the policy [[HYPERLINK POLICY,"Use .. markup"]] to see why the former is used as default). BEGIN/END_COMMA_DELIMITED_TABLE =============================== Type: Directive Description: Delimits a table of comma-delimited data Applies to: Text analysis See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_COMMA_DELIMITED_TABLE ... (lines of comma-delimited data) ... $_$_END_COMMA_DELIMITED_TABLE $_$_END_PRE The BEGIN_COMMA_DELIMITED_TABLE ... END_COMMA_DELIMITED_TABLE directives can be used to delimit a series of comma-delimited data values that should be interpreted as a table (e.g. data originally exported from a spreadsheet such as Excel) The presence of these directives overrides any value set in the [[HYPERLINK POLICY,"Attempt table generation"]] policy BEGIN/END_CONTENTS ================== Type: Directive Description: Delimits a contents list in the original source file Applies to: Text analysis. Mainly HTML generation. See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_CONTENTS ... (original contents list) ... $_$_END_CONTENTS $_$_END_PRE The BEGIN_CONTENTS ... END_CONTENTS directives are used to bracket a contents list in the source document. The program will attempt to automatically detect the presence and location of any contents list in the document, but the algorithm can be problematic. Use this markup only when the document contains a contents list that the program fails to detect correctly. BEGIN/END_DELIMITED_TABLE ========================= Type: Directive Description: Delimits a table of delimited data Applies to: Text analysis See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_DELIMITED_TABLE [] ... (lines of delimited data) ... $_$_END_DELIMITED_TABLE $_$_END_PRE where The delimiter character to use. If omitted the default is tab-delimited. The delimiter can be any character except a comma. For comma-delimited tables use the [[GOTO BEGIN/END_COMMA_DELIMITED_TABLE]] command instead The BEGIN_DELIMITED_TABLE ... END_DELIMITED_TABLE directives can be used to delimit a series of delimited data values that should be interpreted as a table (e.g. data originally exported from a spreadsheet such as Excel) The presence of these directives overrides any value set in the [[HYPERLINK POLICY,"Attempt table generation"]] policy BEGIN/END_DIAGRAM ================= Type: Directive Description: Delimits the start and end of an ASCII diagram Applies to: Text analysis See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_DIAGRAM ... (ASCII diagram) ... $_$_END_DIAGRAM $_$_END_PRE The BEGIN_DIAGRAM ... END_DIAGRAM directives are used to bracket a piece of Ascii art or text diagram in the source text. In HTML this will be rendered in
 ... 
markup. BEGIN/END_HTML ============== Type: Directive Description: Delimits some HTML to be copied to the output Applies to: HTML generation only See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_HTML ... (block of HTML code) ... $_$_END_HTML $_$_END_PRE $_$_BEGIN_HTML AscToHTM $_$_END_HTML The BEGIN_HTML ... END_HTML directives are used to bracket actual HTML in the source document. The bracketed HTML will be transcribed to the output file unconverted. This device will allow you to embed images, tables and other HTML constructs not normally generated by AscToHTM. This is how the image to the right has been added to the HTML version of this document. If you simply wish to insert a single line of HTML, the [[POPUP HTML_LINE]] tag offers a more compact form. For in-line HTML use the [[POPUP HTML]] in-line tag. BEGIN/END_IGNORE ================ Type: Directive Description: Delimits a section of input to be ignored Applies to: All (ignored) See policy: (none) Syntax: $_$_BEGIN_PRE $_$_BEGIN_IGNORE ... (text to be ignored) ... $_$_END_IGNORE $_$_END_PRE This markup can be used to delimit a section to be wholly ignored. Any markup and tags in the ignored section will have no effect. BEGIN/END_PRE ============= Type: Directive Description: Delimits a region of pre-formatted ASCII text Applies to: Text analysis See policy: [[HYPERLINK POLICY,"Minimum automatic
 size"]]

Syntax:

$_$_BEGIN_PRE
	$_$_BEGIN_PRE
	...
	(lines of pre-formatted ASCII text)
	...
	$_$_END_PRE
$_$_END_PRE

The BEGIN_PRE ... END_PRE directives are largely replaced by the
BEGIN/END_TABLE, BEGIN/END_CODE and BEGIN/END_DIAGRAM directives.  They 
are maintained for backwards compatability, and have the same effect as 
the BEGIN/END_DIAGRAM commands


BEGIN/END_TABLE
===============

Type:		Directive
Description:	Delimits a plain text TABLE
Applies to:	Text analysis
See policy:	(none)

Syntax:

$_$_BEGIN_PRE
	$_$_BEGIN_TABLE
	...
	(plain text table with data all aligned)
	...
	$_$_END_TABLE
$_$_END_PRE

The BEGIN_TABLE ... END_TABLE directives are used to bracket a
plain text table in the source text.  The program will then attempt to 
analyse this table as best it can.

This is explained more in the [AscToTab Doco].

Inside this section you can add other TABLE pre-processor commands
to tailor the HTML generated (see [[GOTO The TABLE commands]]).

BEGIN/END_USER_TABLE
====================

Type:		Directive
Description:	Delimits a user-tagged table
Applies to:	Text analysis
See policy:	(none)

*New function*

Syntax:

$_$_BEGIN_PRE
	$_$_BEGIN_USER_TABLE
	...
	$_$_COLUMN_DETAILS ...

	$_$_NEW_ROW
	$_$_NEW_CELL
	... contents of cell (1,1)
	$_$_NEW_CELL
	... contents of cell (1,2)

	$_$_NEW_ROW
	$_$_NEW_CELL
	... contents of cell (2,1)
	$_$_NEW_CELL
	... contents of cell (2,2)
	...
	$_$_END_TABLE
$_$_END_PRE

The BEGIN_USER_TABLE ... END_TABLE directives are used to bracket a
series of tags that describe in detail the layout of a table.  The 
tags used inside the section are

	$_$_COLUMN_DETAILS
	$_$_NEW_ROW
	$_$_NEW_CELL

This approach is only really suitable for use when the files being
converted by AscToRTF are themselves being generated by a software
package that already knows the table structure.

Here's a sample of a user-tagged table (with blank lines added for clarity) :-

$_$_BEGIN_PRE
	$_$_BEGIN_USER_TABLE C,1 in
	$_$_COLUMN_DETAILS 1,,,L, 2 in
	$_$_COLUMN_DETAILS 2,,,C, 1 ins
	$_$_TABLE_BORDER 1

	$_$_NEW_ROW HEAD
	$_$_NEW_CELL
	Substance (units)
	$_$_NEW_CELL
	Year 
	Sampled

	$_$_NEW_ROW DATA
	$_$_NEW_CELL
	Alpha emitters (pCi/L)      
	$_$_NEW_CELL
	1999 

	$_$_NEW_ROW DATA
	$_$_NEW_CELL
	Asbestos (MFL)              
	$_$_NEW_CELL
	1993
	$_$_END_TABLE
$_$_END_PRE

Here's how this table appears when converted into the current format

$_$_BEGIN_USER_TABLE C,1 in
$_$_COLUMN_DETAILS 1,,,L, 2 in
$_$_COLUMN_DETAILS 2,,,C, 1 ins
$_$_TABLE_BORDER 1
$_$_NEW_ROW HEAD
$_$_NEW_CELL
Substance (units)
$_$_NEW_CELL
Year 
Sampled
$_$_NEW_ROW DATA
$_$_NEW_CELL
Alpha emitters (pCi/L)      
$_$_NEW_CELL
1999 
$_$_NEW_ROW DATA
$_$_NEW_CELL
Asbestos (MFL)              
$_$_NEW_CELL
1993
$_$_END_TABLE

See also:-

- [[goto COLUMN_DETAILS]]
- [[goto NEW_ROW]]
- [[goto NEW_CELL]].


BR (line break)
===============

Type:        	In-line
Description: 	Signals a forced line break
Applies to:	HTML and RTF generation
See policy:	(none)

Syntax:

$_$_BEGIN_PRE
	[[OT]]BR[[CT]]
$_$_END_PRE

This tag has no attributes.


CHANGE_POLICY
=============

Type:		Directive
Description:	Changes one of the program's "policies"
Applies to:	All
See policy:	(none)

Syntax:

$_$_BEGIN_PRE
	$_$_CHANGE_POLICY  : 
$_$_END_PRE

where  and  form a policy line as it would 
appear in a policy file, and (usually) as it appears in the [Policy Manual].

NOTE: 	This feature has the potential to cause mayhem, and as such is offered 
	to users on a "as is" basis.  That is, we offer no support for getting 
      	this feature to have the effect a user may desire.

This directive allows you change a particular policy in part of a 
document.  This is a potentially powerful feature, allowing you to tailor
the conversion of your file *in different sections of that file*, or
to embed the policy particular to a file in commands inserted at the top
of the file itself.

For example the following would all be valid directives

$_$_BEGIN_PRE
      	$_$_CHANGE_POLICY Background Colour : red
      	$_$_CHANGE_POLICY Ignore multiple blank lines : Yes
$_$_END_PRE
      
Although how and when they would take affect will depend on the policy.

For example, the background colour would only take effect if splitting 
the file up, and only on the next file generation.  This works, BTW, so
if anyone wants to split a file into many pages, all different colours,
then be my guest.
      
There are a *many* caveats to this behaviour :-

      - *Not all policies are supported*

      	Not all policies may be changed in this way.  In particular policies
      	that open other policy files are not supported.  Even if a policy
      	if "changed", it does not follow that changing the policy will have
      	an effect.

      - *analysis policies*

      	It is unlikely that this feature can be sensibly used to influence the
      	analysis of file, other than when placed at the top of the file only.
      	If such a manner it is simply an alternative to using a separate 
      	policy file.

      - *output policies*

      	Output policies are referenced at different times.  Only those that are
      	referenced *after* the line is read from the source file may be
      	influenced, thus things like output file name may have no effect.

      - *toggleable policies*

      	Not all policies once changed, can be changed back.  This is 
      	particularly of policies that contain values to be added to a list.
      	This is an issue that may be addresses in later versions.
      	
      - *unpredictable behaviour*

      	Messing with policies can cause unpredictable behaviour.  For example
      	if you alter the section splitting parameters, then the chances of a 
      	section cross-reference elsewhere in the document being calculated
      	as a correct hyperlink diminishes.

      	*That's why this feature is offered UNSUPPORTED*

      - *readahead buffer*

      	To further complicate matters, the software uses a readahead, write 
	behind buffer which means that you may need to experiment with the 
	placing of your policy change to within 40 lines (the size of the 
	buffer).

      	This problem is alleviated since version [[TEXT 3.2]].


COLUMN_DETAILS
==============

Type:       	Directive
Description: 	Defines a column in a user-tagged table
Applies to:	Tagged table generation inside a BEGIN/END_USER_TABLE section
See policy:	(none)

*New function*

Syntax:      

$_$_BEGIN_PRE
	$_$_COLUMN_DETAILS ,,
$_$_END_PRE

where

$_$_BEGIN_TABLE
		This is the column number, starting at 1

			This is the alignment of data in this column.
			If omitted this will be auto-detected, but you can
			choose to set it to L(eft), R(ight) or C(enter)

			The width of the column.  If omitted the width will
			be calculated.  As with the  on the table
			the width can be specified in points, inches or 
			centimetres.  If a width is set too narrow, it may
			be ignored.
$_$_END_TABLE

In a user tagged table section BEGIN/END_USER_TABLE the COLUMN_DETAILS commands
are used to define characteristics of each column in the table.

See also :-

- [[goto BEGIN/END_USER_TABLE]]
- [[goto NEW_ROW]]
- [[goto NEW_CELL]]


CONTENTS_LIST
=============

Type:       	Directive or in-line, but better as a directive.
Description: 	Defines the location to place the contents list (if any).  By
      	     	default the contents list is placed at the top of the document
      	     	before any other end-user text.
Applies to:	Mostly HTML generation
See policy:	(none)

Syntax:      

$_$_BEGIN_PRE
        $_$_CONTENTS_LIST ,