#?SuikaWikiConfig/2.0 Plugin: @Name: WikiView @Description: @@@: WikiView interface for template context @@lang:en @License: %%GPL%% @Author: @@Name: @@@@: Wakaba @@@lang:ja @@@script:Latn @@Mail[list]: w@suika.fam.cx @Date.RCS: $Date: 2003/10/25 06:37:31 $ PluginConst: @NS_XHTML1: http://www.w3.org/1999/xhtml @NS_SGML: urn:x-suika-fam-cx:markup:sgml: FormattingRule: @Category[list]: view @Name: predefined-template @Description: @@@: (Obsolete -- Use "template" instead) @@lang:en @Formatting: my $orig_children = $o->{var}->{wv__children}; $o->{var}->{wv__children} = $p; my $formatter = $o->formatter ('view'); $r = $formatter->replace ($o->{wiki}->{view}->assemble_template ($p->{name}), $o, {formatter => $formatter}); $o->{var}->{wv__children} = $orig_children; FormattingRule: @Category[list]: view @Name: template @Description: @@@: Instantiate template. In addition to normal parameters, parameter name prefixed by "-" can be specified to replace "%apply-template (name => (name w/o prefix));" in instantiated template. Warning: Attemplt to apply template which directly or indirectly referring "parent" template will make a infinite loop. @@lang: en @Parameter: @@Name: name @@Type: name @@Default: #REQUIRED @@Description: @@@@: Template name @@@lang:en @Formatting: my $orig_children = $o->{var}->{wv__children}; $o->{var}->{wv__children} = $p; my $formatter = $o->formatter ('view'); $r = $formatter->replace ($o->{wiki}->{view}->assemble_template ($p->{name}), $o, {formatter => $formatter}); $o->{var}->{wv__children} = $orig_children; FormattingRule: @Category[list]: view @Name: apply-template @Description: @@@: Instantiate template defined as a "-" prefixed parameter of "parent" %template; rule. @@lang: en @Parameter: @@Name: name @@Type: name @@Default: #REQUIRED @@Description: @@@@: Name of parameter defining the template, without "-" prefix @@@lang:en @Formatting: my $template = $o->{var}->{wv__children}->{'_'.$p->{name}}; if (length $template) { my $formatter = $o->formatter ('view'); $r = $formatter->replace ($template, $o, {formatter => $formatter}); } FormattingRule: @Category[list]: view @Name: -bare-text @Formatting: $r = Message::Markup::XML->new (type => '#text', value => $p->{-bare_text}); FormattingRule: @Category[list]: view view-resource page-link @Name: char @Description: @@@: A character @@lang: en @Parameter: @@Name: ucs @@Type: "U+hhhh / U+hhhhhh / U-hhhhhhhh" @@Default: #REQUIRED @@Description: @@@@: UCS code position of the character @@@lang:en @Formatting: if ($p->{ucs} =~ /^U\+([0-9A-Fa-f]{4,6})$/) { $r = Message::Markup::XML->new (type => '#reference', namespace_uri => $NS_SGML.'char:ref', value => hex $1); } elsif ($p->{ucs} =~ /^U-([0-9A-Fa-f]{8})$/) { $r = Message::Markup::XML->new (type => '#ref', namespace_uri => $NS_SGML.'char:ref:hex', value => hex $1); } else { $r = Message::Markup::XML->new (type => '#ref', namespace_uri => $NS_SGML.'char:ref:hex', value => 0xFFFD); }