Index


RISC World

Editing a Mapping file

This is actually the most complex part of the program.

If you click ADJUST on the icon bar icon or select 'Mappings' from the menu the mappings window will open.

There's a lot going on in this window. You will see that it's divided into three main areas.

At the top left are the 'Effects'. This is where you set the HTML codes that will be used for Bold, Italic, Underline, Centre and Tab.

At the top right is the section which enables you to load existing Mappings files for modification and to save files.

The main part of the window is where Impression Styles are given the characteristics that will be used in HTML documents.

Altering the definitions

You could create a completely new Mapping file but it will be easier to begin by looking at a completed one. Click on the menu icon labelled 'Edit file' and a menu will appear with the names of all the available Mapping files. At present this will just show 'DefaultMap' and 'Manual'. Select 'Manual' and the file will be loaded and its definitions will appear in the window and its name will be shown in the icon under the 'Edit file' label. The 'Effects' section of the window should now look like this.

Editing the Effects

The top four items, Bold, Italic, Underline and Centre each have an icon where the HTML code used to switch the effect on and off is shown. You can enter these affects either by typing them in directly or by selecting from the menu that will appear if you click on the corresponding menu icon.

The top item on the menu is 'Clear', and if you click on this the icons for that item will be cleared ready for you to enter or select a new code.

The last item is 'Newline'. This doesn't put a <BR> code in the HTML to break the line, it puts a '\n' code in the Effect definition which just places a newline character (ascii 10) in the file so the source file will have the line split at that point. This is done just to make the source file easier to read and edit. For example, it is used with the 'centre' code to make centred lines more obvious.

The last item, Tab, obviously requires only one icon. Again there is a menu but it's much simpler. As there's no direct equivalent to the Tab character in HTML and multiple spaces are concatenated to a single space the best option if you must have some sort of Tab is multiple &nbsp; codes (non-breaking spaces).

The final two buttons in this window are 'Clear' and 'Default'

'Clear' will clear all the Effects icons ready for you to select or type new codes.

'Default' will insert a series of default codes as shown

Editing the Styles

The Styles section of the window is shown below.

The icon labelled 'Style name' shows the name of the Style as it appears on Ovation Pro's Style menu. The other two 'white' icons show the HTML codes that will be substituted for the 'on' and 'off' commands for these codes. These icons, like those for the effects, are writable, so they can be entered (or added to) manually or selected from a menu. If you click on the menu icon on the right the menu shown will appear, and selecting anything from this menu adds the appropriate 'on' and 'off' codes to the contents of the icons.

Instead of describing the actions of all the icons I'll describe each Style in the example above and explain how it is used and what effect the various buttons have on it.

First there is Main Heading . In the original document this is centred 28pt. Bold, and is used at the start of each main section or 'chapter'. So, <H2> has been chosen, and it is also centred. Because the use of this Style signifies the start of a new chapter the icon on the extreme right, labelled 'NC' (for New Chapter) is ticked. When creating multi-chapter HTML this will begin a new chapter file whenever this Style is found. Styles where 'NC' is ticked will also automatically appear in the Index file so there's no need to tick this as well.

Sub Heading' is used in the original document for the headings to each section, so I've chosen <H4> as an appropriate tag.

The three buttons labelled 'p', 'br' and 'none' define what (if any) tags are used at the end of each line, or, more accurately, each time a linefeed (ascii 10) character is found. As Ovation Pro exports text in DDL files unformatted this will only appear if you pressed RETURN when writing the text, such as at the end of a paragraph.

'p' means that each paragraph is wrapped in <P> and </P> tags. This is what you would use for the main body of your text. This is 'on' by default, so it will be applied to the one Style not shown on the menu but which exists in all Ovation Pro documents, namely 'Basestyle'. This is simply the default text used in the browser. As it happens, since this is a fairly simple Mappings file, all the other styles don't use <P> and </P>, so none of them have this option set.

'br' means use <BR> at the end of a line instead of <P> and </P> so there will be no gap between paragraphs as is otherwise the case. This is used for the Style NoGap . In the original Impression document there is normally a 3pt gap between paragraphs to separate them. NoGap is the same as the main body text but without this gap and is used where I don't want a gap between lines when I press RETURN. In the HTML mapping it has no definition other than having 'br' selected, so it's the same as the main body text but will have <BR> at the ends of lines so there won't be a gap between paragraphs, just as in the original document.

'none' means exactly that . There is no <BR> os </P> tag at the ends of lines. This is applied to the two Heading Styles because these are used only for single lines (Main and Sub headings) and in HTML an <H?> tag always begins a new line and a new line is begun after an </H?> tag so there's no need.

The Style Code would be used in the original document where I wanted to enter something like example code and is defined with a monospaced font (actually Corpus) and no gap between lines. This is therefore converted to <PRE> tags in HTML with no tags at the end of lines as all browsers will being a new line in <PRE> mode when they find a linefeed but many will add another when they find <BR>, so if <BR> was used the text would all be double-spaced.

More on the Styles menu

This menu is 'user configurable' (see later) so you can have whatever codes you prefer on it and omit those you don't use to make it more manageable if you like.

The 'Fontsize +1' and 'Fontsize +2' items can be used, often in combination with a Bold tag, to give larger than normal text where you don't want to use an <H?> tag. As the tags can be edited after you've selected them it's easy to alter this to '+3' or even '-1' after you've selected them so you don't need a menu entry for everything you might want to use.

'nbsp' inserts a &nbsp; tag but only in the 'on' section. This is a simply way of indenting a sub heading a little.

'Line' inserts a <HR> tag into the 'on' section. This is useful in long HTML documents, especially if you are not breaking it up into chapters as it can be used to provide a 'visual' break between sections.

Saving a Mappings file

To save a mappings file just click on 'Save'. Unless this is a new file (see next section' you may want to change its name first. If you try to save a file and one of the same name already exists you will be warned first.

When you save a Mappings file only those Styles where the icon at the extreme left is ticked will be included. This lets you omit styles which have no appropriate HTML equivalent. Imp-HTML will simply ignore any styles that aren't included in the Mappings file so they'll appear in the base style.

!OV-HTML is Copyright © David Holden 2002.

 Index