#?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: 2004/02/08 08:52:03 $ @RequiredPlugin[list]: Error @Use: use Message::Markup::XML::Node qw(SGML_HEX_CHAR_REF SGML_NCR); PluginConst: @NS_XHTML1: http://www.w3.org/1999/xhtml 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: local $o->{var}->{wv__children} = $p; SuikaWiki::Plugin ->formatter ('view') ->replace ($o->{wiki}->{view}->assemble_template ($p->{name}), param => $o, -parent => $p->{-parent}); 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) { SuikaWiki::Plugin ->formatter ('view') ->replace ($template, param => $o, -parent => $p->{-parent}); } FormattingRule: @Category[list]: view view-resource form-input @Name: -bare-text @Formatting: $p->{-parent}->append_text ($p->{-bare_text}); FormattingRule: @Category[list]: view view-resource form-input page-link link-to-wikipage we--edit @Name: -undef @Formatting: $p->{-parent}->append_text ("[$f->{-category_name}/$rule_name: not defined]"); 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: __ATTRTEXT:%ucs__; if ($p->{ucs} =~ /^U\+([0-9A-Fa-f]{4,6})$/) { my $char = hex $1; if ($o->{wiki}->{var}->{client}->{downgrade}->{html_no_latin1} and $char <= 0x00FF and 0x00A0 <= $char) { $p->{-parent}->append_text ({ 0xA0 => ' ', 0xA9 => '(C)', }->{$char} || sprintf '&#x%02X;', $char); } else { $p->{-parent}->append_new_node (type => '#reference', namespace_uri => SGML_NCR, value => hex $1); } ## Note: NC4 does not support hexdecimal character reference. } elsif ($p->{ucs} =~ /^U-([0-9A-Fa-f]{8})$/) { $p->{-parent}->append_new_node (type => '#reference', namespace_uri => SGML_HEX_CHAR_REF, value => hex $1); } else { $p->{-parent}->append_new_node (type => '#reference', namespace_uri => SGML_HEX_CHAR_REF, value => 0x0000FFFD); } ViewDefinition: @Mode: -wv--no-view-definition @Condition: @@http-method[list]: GET HEAD POST @Description: @@@: WikiView definition matches to the request not found @@lang: en @template: @@http-status-code: 406 @@http-status-phrase: WikiView Definition Not Found @@media-type: text/html @@use-media-type-charset: 1 @@expires: %%error%% @@body: %html-document ( title => {%res (name => {WikiView:NoViewDef:WebPageTitle});}p, link-meta => {%template (name => links);}p, content => { %block (id => tools1, class => tools, content => {%template (name => navbar);}p); %section ( title => {%res (name => {WikiView:NoViewDef:Title});}p, heading, content => {%paragraph ( content => {%res (name => {WikiView:NoViewDef:Description});}p, );%error-list ( no-error => {%res (name => {Error:NoErrorReported});}p, );}p, ); %block (id => footer, content => {%template (name => ws--footer);}p); }p, ); Resource: @WikiView:NoViewDef:Description: @@@: WikiView definition that matches to your request does not found. @@lang: en @WikiView:NoViewDef:Title: @@@: WikiView Definition Not Found @@lang: en @WikiView:NoViewDef:WebPageTitle: @@@: 406 WikiView Definition Not Found (%page-name;) @@lang: en