NAME

FreePWING::FPWUtils::MarkupInterface - simple markup interface for FreePWING


SYNOPSIS

  use FreePWING::FPWUtils::MarkupInterface;
  FreePWING_write("<entry><heading>$item</heading>" .
                  "<key name=\"$kanji\"><key name=\"$kana\">" .
                  "<keyword>$kanji [$kana]</keyword><nl>".
                  "<indent level=\"2\">$content<nl>");
  # encode &, <, >, and " characters
  $string = FreePWING_encode($string);
  FreePWING_write($string);


DESCRIPTION

The FreePWING::FPWUtils::MarkupInterface is an alternative interface to FreePWING::FPWUtils::FPWParser (http://www.sra.co.jp/people/m-kasahr/freepwing/). This module controls the FreePWING parser via a simple markup language (see MARKUP).

The following functions are available:

FreePWING_write($string);
Pass commands and data via markup tags (see MARKUP) to trigger FreePWING functions.

FreePWING_encode($string, $unsafe_chars);
Replace unsafe characters in $string with their entity representation. The characters &, <, >, and `` are considered unsafe by default. An optional second argument string may be used to define ones own set of unsafe characters. Returns encoded string.


MARKUP

<entry>
Creates a new dictionary entry. Must be followed by <heading>$text</heading> where $text typically appears in the hits field of an application. <keyword>$text</keyword> marks the head word of the actual entry. <key name="$key"> is used to indicate a search key. The optional ``conditional'' attribute to <key> may be used for conditional keys.

<menu>
Creates a new menu entry.

<copyright>
Creates a new copyright entry.

General markup
<entry>, <menu>, and <copyright> may be followed by additional markup. In the following (*) denotes markup which is not allowed within <heading></heading> and (+) denotes markup which is not allowed within <keyword></keyword>.

<tag name=``$name''> and <ref $target=``$name''> (*,+)
Add tag $name and refer to it. Tags always belong to an entry as a whole.

<gaiji type=``$type'' name=``$name''>
Add gaiji character $name of type ``half'' or ``full''. See FreePWING documentation on HALFCHARS and FULLCHARS on how to associate names with actual files.

<image name=``$name''>$caption</image> (*)
Add image $name and optional $caption. See FreePWING documentation on CGRAPHS on how to associate names with actual files.

<nl>
Create a newline.

<indent level=``$level''>
Indent the following line(s) by $level.

<b></b>, <i></i>, <em></em>, <sub></sub>, and <super></super>
Bold, italics, emphasized, subscripted and superscripted text.

<nowrap></nowrap>
Prevent wrapping of text.


COPYRIGHT

Copyright 2005 Hannes Loeffler.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.