7-30 Administrators Guide for Dynamic Converter
You cannot mix old-style Inso macros with the new {} macro style in the same template.
No new or future features that Dynamic Converter will include support the old syntax. Thus, for example, the old syntax has not been extended to include support for
the new { UNIT} macros.
7.5 Pragmas
Pragmas provide access to certain document elements that are not logically part of the element tree. The following pragmas are supported:
■
Pragma.Charset
■
Pragma.CSSFile
■
Pragma.EmbeddedCSS
■
Pragma.JsFile
■
Pragma.SourceFileName
7.5.1 Pragma.Charset
This pragma represents the HTML text string associated with the character set of the characters that Dynamic Converter is generating. In order for Dynamic Converter to
correctly code the character set into the HTML it generates, all templates should include a META tag that uses the { INSERT} macro as follows:
META HTTP-EQUIV=Content-Type CONTENT=texthtml; charset={ INSERT ELEMENT=pragma.charset}
If the template does not include this line, the user will have to manually select the correct character set in their browser.
7.5.2 Pragma.CSSFile
This pragma is used to insert the name of the Cascading Style Sheet CSS file into HTML documents. This name is typically used in conjunction with an HTML LINK
tag to reference styles contained in the CSS file generated by Dynamic Converter.
When used with the { INSERT} macro, this pragma will generate the URL of the CSS file that is created. This macro must be used with { INSERT} inside every template
file that inserts contents of the source file and when the selected HTML flavor supports CSS. The CSS file will only be created if the selected HTML flavor supports
CSS.
When used with the { IF} macro, the conditional will be true if the selected HTML flavor supports Cascading Style Sheets or not.
If CSS is required for the output, { IF element=pragma.embeddedcss} or { IF element=pragma.cssfile} must be used. However, Dynamic Converter does not
differentiate between the two, as the choice of using embedded CSS vs. external CSS is your decision and you may even wish to mix the two in the output.
An example of how to use this pragma that works when exporting either CSS or non-CSS flavors of HTML would be as follows:
{ IF ELEMENT=Pragma.CSSFile} LINK REL=STYLESHEET
HREF={ INSERT ELEMENT=Pragma.CSSFile}
Script Templates 7-31
LINK { IF}
7.5.3 Pragma.EmbeddedCSS
This pragma is used to insert CSS style definitions in a single block in the HEAD of the document.
When used with the { INSERT} macro, this pragma will insert the block of CSS style definitions needed for use later in the file. This macro must be used inside every
output HTML file where { INSERT} is used to insert document content.
When used with the { IF} macro, the conditional will be true if the selected HTML flavor supports CSS.
If CSS is required for the output, { IF element=pragma.embeddedcss} or { IF element=pragma.cssfile} must be used. However, Dynamic Converter does not
differentiate between the two, as the choice of using embedded CSS vs. external CSS is your decision and you may even wish to mix the two in the output.
If a style is used anywhere in the input document, that style will show up in the embedded CSS generated for all the output HTML files generated for the input file.
Consider a template that splits its output into multiple HTML files. In this example, the input file contains the MyStyle style. It does not matter if during the conversion
only one output HTML file actually references the MyStyle style. The MyStyle style definition will still show up in the embedded CSS for all the output files, including
those files that never reference this style.
7.5.4 Pragma.JsFile