/[pub]/suikawiki/script/lib/SuikaWiki/Plugin/WikiView.wp2
Suika

Contents of /suikawiki/script/lib/SuikaWiki/Plugin/WikiView.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Oct 25 06:37:31 2003 UTC (21 years, 6 months ago) by wakaba
Branch: MAIN
Imported to CVS

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     @Date.RCS: $Date:$
16    
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: predefined-template
26     @Description:
27     @@@: (Obsolete -- Use "template" instead)
28     @@lang:en
29     @Formatting:
30     my $orig_children = $o->{var}->{wv__children};
31     $o->{var}->{wv__children} = $p;
32     my $formatter = $o->formatter ('view');
33     $r = $formatter->replace ($o->{wiki}->{view}->assemble_template ($p->{name}),
34     $o, {formatter => $formatter});
35     $o->{var}->{wv__children} = $orig_children;
36    
37     FormattingRule:
38     @Category[list]: view
39     @Name: template
40     @Description:
41     @@@:
42     Instantiate template.
43    
44     In addition to normal parameters, parameter name prefixed by "-"
45     can be specified to replace "%apply-template (name => (name w/o prefix));"
46     in instantiated template.
47    
48     Warning: Attemplt to apply template which directly or indirectly referring
49     "parent" template will make a infinite loop.
50     @@lang: en
51     @Parameter:
52     @@Name: name
53     @@Type: name
54     @@Default: #REQUIRED
55     @@Description:
56     @@@@: Template name
57     @@@lang:en
58     @Formatting:
59     my $orig_children = $o->{var}->{wv__children};
60     $o->{var}->{wv__children} = $p;
61     my $formatter = $o->formatter ('view');
62     $r = $formatter->replace ($o->{wiki}->{view}->assemble_template ($p->{name}),
63     $o, {formatter => $formatter});
64     $o->{var}->{wv__children} = $orig_children;
65    
66     FormattingRule:
67     @Category[list]: view
68     @Name: apply-template
69     @Description:
70     @@@:
71     Instantiate template defined as a "-" prefixed parameter of "parent"
72     %template; rule.
73     @@lang: en
74     @Parameter:
75     @@Name: name
76     @@Type: name
77     @@Default: #REQUIRED
78     @@Description:
79     @@@@: Name of parameter defining the template, without "-" prefix
80     @@@lang:en
81     @Formatting:
82     my $template = $o->{var}->{wv__children}->{'_'.$p->{name}};
83     if (length $template) {
84     my $formatter = $o->formatter ('view');
85     $r = $formatter->replace ($template,
86     $o, {formatter => $formatter});
87     }
88    
89     FormattingRule:
90     @Category[list]: view
91     @Name: -bare-text
92     @Formatting:
93     $r = Message::Markup::XML->new (type => '#text', value => $p->{-bare_text});
94    
95     FormattingRule:
96     @Category[list]:
97     view
98     view-resource
99     page-link
100     @Name: char
101     @Description:
102     @@@:
103     A character
104     @@lang: en
105     @Parameter:
106     @@Name: ucs
107     @@Type: "U+hhhh / U+hhhhhh / U-hhhhhhhh"
108     @@Default: #REQUIRED
109     @@Description:
110     @@@@: UCS code position of the character
111     @@@lang:en
112     @Formatting:
113     if ($p->{ucs} =~ /^U\+([0-9A-Fa-f]{4,6})$/) {
114     $r = Message::Markup::XML->new
115     (type => '#reference',
116     namespace_uri => $NS_SGML.'char:ref',
117     value => hex $1);
118     } elsif ($p->{ucs} =~ /^U-([0-9A-Fa-f]{8})$/) {
119     $r = Message::Markup::XML->new
120     (type => '#ref',
121     namespace_uri => $NS_SGML.'char:ref:hex',
122     value => hex $1);
123     } else {
124     $r = Message::Markup::XML->new
125     (type => '#ref',
126     namespace_uri => $NS_SGML.'char:ref:hex',
127     value => 0xFFFD);
128     }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24