Next Previous Up Top Contents Index

WebMaker User Guide

10.1 Creating new WML conversion rules

The process that we recommend for creating new conversion rules is:

1. Identify the predefined conversion rule that most closely matches the conversion behavior you want to achieve. In this example, we choose the QuotedText rule. It indents text they way we like, but we want to make that text appear in italics.
2. Use an ordinary text editor to edit a new file that contains a copy of that conversion rule. We do not want to modify anything in the predefined file; we simply want to copy that rule to another file and modify it there. For example, we chose to copy the QuotedText rule from the normals.wml file to a second file, named custom-rules.wml.
3. Edit the copy of the conversion rule to change its name. For example, we will give our new rule the name QuotedTextItalic. Use WML functions to modify the behavior of the rule.
4. As an initial test of whether you have written correct WML syntax, open the custom-rules.wml file in WebMaker. WebMaker will report any syntactic errors it finds.
5. Modify the WML file that contains mappings between paragraph tags and predefined conversion rules to include the file custom-rules.wml. In this example, the mappings file is named manual.wml. Make that WML file include the new file, custom-rules.wml. You can do that by using the WebMaker user interface, choosing the Includes view, and using Edit>New Include, or by using an ordinary text editor to edit manual.wml.
6. To test the conversion rule, make one of your paragraph tags map to the new rule, convert that document, and view the result in a browser.