Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

22 Setting up CSS for HTML > 22.4 Specifying CSS file and link options > 22.4.2 Specifying CSS options in a Mif2Go configuration file


22.4.2 Specifying CSS options in a Mif2Go configuration file

To specify CSS options in a Mif2Go configuration file:

[CSS]

; UseCSS = Yes (default) or No

UseCSS=Yes

; WriteClassAttributes = Yes (default)

;  or No (when ClassIsTag=Yes or when not using CSS)

WriteClassAttributes=Yes

; WriteCssStylesheet = Once (default), Always, or Never

WriteCssStylesheet=Once

; WriteCssLink = Yes (default) or No

WriteCssLink=Yes

; CssBrowserDetect= Macro reference to JavaScript code that determines

; browser type and writes link from HTML to appropriate CSS file

;CssBrowserDetect=<$BrowserCSS>

; CssFileName = name of style sheet to reference (file name, no path)

CssFileName=local.css

Use these options to do the following:

Direct Mif2Go to use CSS

Include class attributes

Designate a CSS file

Create a CSS file

Link to a CSS file

Select a CSS file at run time

See also §Table 22-2 CSS-dependent default values of options.

Note:  If you have been using [HtmlOptions]Stylesheet to specify CSS file options, see §22.4.5 Understanding effects of the older Stylesheet setting. The Stylesheet setting is deprecated in favor of the [CSS] settings listed in this section.

Direct Mif2Go to use CSS

To direct Mif2Go to use CSS for your output:

[CSS]

; UseCSS = Yes (default) or No

UseCSS=Yes

When UseCSS=Yes, by default Mif2Go does the following:

includes class attributes in paragraph tags

creates the CSS file designated by CssFileName, if this file is not already present

includes a link from the <head> element of each output file to the CSS file designated by CssFileName.

When UseCSS=No, paragraph tags do not include class attributes, no CSS file is referenced in the output, and the remaining [CSS] options are ignored.

See also §22.5 Understanding how CSS affects other options.

Include class attributes

WriteClassAttributes values have the following effects: 

[spacer]

Yes

Mif2Go includes CSS class attributes in the paragraph tags in your output; see §22.3 Understanding how Mif2Go generates CSS.

No

Class attributes are not included in paragraph tags. Use this setting for XML output when [CSS]ClassIsTag=Yes, the default for XML; see §14.4.2 Deriving XML tags from format and class names.

Designate a CSS file

CssFileName designates the CSS file Mif2Go optionally creates and references. The default is local.css, located in the project directory. You can specify a different name and location for this file; see §22.4.3 Designating and locating a CSS file.

Create a CSS file

WriteCssStylesheet values have the following effects: 

Once

Mif2Go creates a new CSS file based on your FrameMaker formats, but only if no CSS file of the name designated by CssFileName is already present in the project directory. This is the default Mif2Go puts in place at set-up. Specify Once to get a starting CSS file that you can tweak manually. See §22.4.4 Directing Mif2Go to generate a CSS file.

Always

Mif2Go creates a new CSS file based on your FrameMaker formats, overwriting in the project directory any existing CSS file of the name designated by CssFileName. Specify Always if you do not need to tweak the CSS file, or if you can make any needed changes in macros, either in the configuration file or in a macro library. See §22.4.4 Directing Mif2Go to generate a CSS file. You can specify additional settings to govern what Mif2Go includes in a CSS file; see §22.8.4 Overriding styles in Mif2Go-generated CSS files.

Never

Mif2Go does not create a new CSS file, nor overwrite an existing file. When UseCSS=Yes, Mif2Go assumes you wish to use an existing CSS file: either the file designated by CssFileName, or a file to be selected at run time, depending on the values of WriteCssLink and CssBrowserDetect. Specify Never if you want to use an existing CSS file. See §22.4.3 Designating and locating a CSS file.

Link to a CSS file

WriteCssLink values have the following effects: 

Yes

If CssBrowserDetect is not present, Mif2Go includes in the <head> element a simple link to the CSS file designated by CssFileName, in the relative directory designated by CssPath. The link is one of the following types:

For HTML:

<link rel="stylesheet" href="local.css" type="text/css">

For XML:

<?xml:stylesheet href="local.css" type="text/css" charset="UTF-8"?>

If CssBrowserDetect is present, instead of the simple link Mif2Go includes the macro assigned to CssBrowserDetect in the <head> element. See §22.6.1 Selecting a CSS file at run time.

No

Mif2Go does not create a link to a CSS file. Use this setting when you are not using CSS, or when you provide your own macro in [Inserts]Head to select a CSS file dynamically, independently of CssBrowserDetect. See §22.6.1 Selecting a CSS file at run time.

Select a CSS file at run time

When a macro is assigned to CssBrowserDetect, if WriteCssLink=Yes, the macro is included in the <head> element. If WriteCssLink=No, the macro is ignored. See §22.6.1 Selecting a CSS file at run time.



22 Setting up CSS for HTML > 22.4 Specifying CSS file and link options > 22.4.2 Specifying CSS options in a Mif2Go configuration file