| 1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
|
|
| 3 |
|
|
Plugin: |
| 4 |
|
|
@Name: WikiView |
| 5 |
|
|
@Description: |
| 6 |
|
|
@@@: WikiView interface for template context |
| 7 |
|
|
@@lang:en |
| 8 |
|
|
@License: %%GPL%% |
| 9 |
|
|
@Author: |
| 10 |
|
|
@@Name: |
| 11 |
|
|
@@@@: Wakaba |
| 12 |
|
|
@@@lang:ja |
| 13 |
|
|
@@@script:Latn |
| 14 |
|
|
@@Mail[list]: w@suika.fam.cx |
| 15 |
wakaba |
1.2 |
@Date.RCS: $Date: 2003/10/25 06:37:31 $ |
| 16 |
wakaba |
1.1 |
|
| 17 |
|
|
PluginConst: |
| 18 |
|
|
@NS_XHTML1: |
| 19 |
|
|
http://www.w3.org/1999/xhtml |
| 20 |
|
|
@NS_SGML: |
| 21 |
|
|
urn:x-suika-fam-cx:markup:sgml: |
| 22 |
|
|
|
| 23 |
|
|
FormattingRule: |
| 24 |
|
|
@Category[list]: view |
| 25 |
|
|
@Name: template |
| 26 |
|
|
@Description: |
| 27 |
|
|
@@@: |
| 28 |
|
|
Instantiate template. |
| 29 |
|
|
|
| 30 |
|
|
In addition to normal parameters, parameter name prefixed by "-" |
| 31 |
|
|
can be specified to replace "%apply-template (name => (name w/o prefix));" |
| 32 |
|
|
in instantiated template. |
| 33 |
|
|
|
| 34 |
|
|
Warning: Attemplt to apply template which directly or indirectly referring |
| 35 |
|
|
"parent" template will make a infinite loop. |
| 36 |
|
|
@@lang: en |
| 37 |
|
|
@Parameter: |
| 38 |
|
|
@@Name: name |
| 39 |
|
|
@@Type: name |
| 40 |
|
|
@@Default: #REQUIRED |
| 41 |
|
|
@@Description: |
| 42 |
|
|
@@@@: Template name |
| 43 |
|
|
@@@lang:en |
| 44 |
|
|
@Formatting: |
| 45 |
|
|
my $orig_children = $o->{var}->{wv__children}; |
| 46 |
|
|
$o->{var}->{wv__children} = $p; |
| 47 |
|
|
my $formatter = $o->formatter ('view'); |
| 48 |
|
|
$r = $formatter->replace ($o->{wiki}->{view}->assemble_template ($p->{name}), |
| 49 |
|
|
$o, {formatter => $formatter}); |
| 50 |
|
|
$o->{var}->{wv__children} = $orig_children; |
| 51 |
|
|
|
| 52 |
|
|
FormattingRule: |
| 53 |
|
|
@Category[list]: view |
| 54 |
|
|
@Name: apply-template |
| 55 |
|
|
@Description: |
| 56 |
|
|
@@@: |
| 57 |
|
|
Instantiate template defined as a "-" prefixed parameter of "parent" |
| 58 |
|
|
%template; rule. |
| 59 |
|
|
@@lang: en |
| 60 |
|
|
@Parameter: |
| 61 |
|
|
@@Name: name |
| 62 |
|
|
@@Type: name |
| 63 |
|
|
@@Default: #REQUIRED |
| 64 |
|
|
@@Description: |
| 65 |
|
|
@@@@: Name of parameter defining the template, without "-" prefix |
| 66 |
|
|
@@@lang:en |
| 67 |
|
|
@Formatting: |
| 68 |
|
|
my $template = $o->{var}->{wv__children}->{'_'.$p->{name}}; |
| 69 |
|
|
if (length $template) { |
| 70 |
|
|
my $formatter = $o->formatter ('view'); |
| 71 |
|
|
$r = $formatter->replace ($template, |
| 72 |
|
|
$o, {formatter => $formatter}); |
| 73 |
|
|
} |
| 74 |
|
|
|
| 75 |
|
|
FormattingRule: |
| 76 |
|
|
@Category[list]: view |
| 77 |
|
|
@Name: -bare-text |
| 78 |
|
|
@Formatting: |
| 79 |
|
|
$r = Message::Markup::XML->new (type => '#text', value => $p->{-bare_text}); |
| 80 |
|
|
|
| 81 |
|
|
FormattingRule: |
| 82 |
|
|
@Category[list]: |
| 83 |
|
|
view |
| 84 |
|
|
view-resource |
| 85 |
|
|
page-link |
| 86 |
|
|
@Name: char |
| 87 |
|
|
@Description: |
| 88 |
|
|
@@@: |
| 89 |
|
|
A character |
| 90 |
|
|
@@lang: en |
| 91 |
|
|
@Parameter: |
| 92 |
|
|
@@Name: ucs |
| 93 |
|
|
@@Type: "U+hhhh / U+hhhhhh / U-hhhhhhhh" |
| 94 |
|
|
@@Default: #REQUIRED |
| 95 |
|
|
@@Description: |
| 96 |
|
|
@@@@: UCS code position of the character |
| 97 |
|
|
@@@lang:en |
| 98 |
|
|
@Formatting: |
| 99 |
|
|
if ($p->{ucs} =~ /^U\+([0-9A-Fa-f]{4,6})$/) { |
| 100 |
|
|
$r = Message::Markup::XML->new |
| 101 |
|
|
(type => '#reference', |
| 102 |
|
|
namespace_uri => $NS_SGML.'char:ref', |
| 103 |
|
|
value => hex $1); |
| 104 |
|
|
} elsif ($p->{ucs} =~ /^U-([0-9A-Fa-f]{8})$/) { |
| 105 |
|
|
$r = Message::Markup::XML->new |
| 106 |
|
|
(type => '#ref', |
| 107 |
|
|
namespace_uri => $NS_SGML.'char:ref:hex', |
| 108 |
|
|
value => hex $1); |
| 109 |
|
|
} else { |
| 110 |
|
|
$r = Message::Markup::XML->new |
| 111 |
|
|
(type => '#ref', |
| 112 |
|
|
namespace_uri => $NS_SGML.'char:ref:hex', |
| 113 |
|
|
value => 0xFFFD); |
| 114 |
|
|
} |