Formatter Markup



Portable Presenter has a few formatters, which each enable someone to specify what text should appear on a slide. The markup formatter is very close to HTML, but there are a few important differences. There are to simplified versions (sub-classes) of the markup formatter: simple and plain.

Differences between markup and HTML

  • Each tag can be used as a container and as a switch. For instance:
        <TEXT COLOR=red>Some text</TEXT>
        <P>a paragraph with one <LARGE>large</LARGE>
           word and three <SMALL>small words.
        See the demo.
    Most tags are equivalent to those of HTML, but a few are new. The example shows three containers: TEXT, P, and LARGE. In this case, SMALL and B are used as switches. They end with the enclosing container, so at </P>.

    The results shows:

    Some text

    a paragraph with one large word and three small words. bold
    See the demo.

    Tags are not case sensitive, so you may use lowercase. <SMALL> and <LARGE> are logical styles, in contrast to <B> which is a visual style.

  • Visual tags which change the font, like <TT>, can also be used as parameter: <P TT>.

  • You can add logical tags, which are translated into visual tags. For instance have <EMAIL> translated into <TT B>.

Markup Formatter Options

The markup-formatter is a sub-class of the formatters, so you also have to look at the

logicals => ref-to-hash
Hash which defines the translation of logical tags into visual tags. Logical tags can not be used as parameter to an other tag (to avoid recursion), where most visual tags can.

Modify this list as demonstrated below, and never directly, because that would change the translations of previously slides too, which is unexpected behaviour.

specials => ref-to-hash
Hash which defines the translation of special characters into visual characters. Writing HTML-like text causes some conflicts, as for instance the "<" is used to define tags. In real HTML, you have to write &lt;, and the same for this markup formatter.

Predefined special characters are:
&nbsp;hard space

Below is demonstrated how to add special characters. You should never change the content of the hash directly.

Adding Logical Tags

You can add logical tags, which are translated into visual tags. For instance: (somewhere inbetween the slides)
    $show->find('formatter', 'markup')
         ->addLogical(EMAIL => 'TT B');
    $show->select(formatter => 'markup')
         ->addLogical(EMAIL => 'TT B');
or (in the script's preamble)
    $show->select('formatter', 'markup')
         ->addLogical(EMAIL => 'TT B');

You can add a whole list of logicals at once (preferred!):

    $show->find(formatter => 'markup')
         ->addLogicals(EMAIL => 'TT B',
       DEMO => 'FONT SIZE=+1 COLOR=green');
Note that addLogical is equivalent to addLogicals. You can only translate logical tags into visual tags, so in this case I was forced to write FONT SIZE=+1 in stead of LARGE because LARGE is a predefined logical.

Adding Special Characters

The way you add special characters is equivalent to the way that logicals are added, as described above. The function involved is addSpecialCharacter (same as addSpecialCharacters).

The argument to the function is a list of name to representation conversions:

    $show->select(formatter => 'markup')
            (euro => 'EURO', tilde => '~');
After this definition, you can use &euro; and &tilde; in your text.

Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF.