/[pub]/suikawiki/script/misc/plugins/link/iw-wikiengine.wp2
Suika

Diff of /suikawiki/script/misc/plugins/link/iw-wikiengine.wp2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun Feb 1 12:09:44 2004 UTC revision 1.4 by wakaba, Wed Mar 10 06:57:25 2004 UTC
# Line 6  Plugin: Line 6  Plugin:
6      @@@:      @@@:
7        InterWiki - External WikiEngine URI Reference Support        InterWiki - External WikiEngine URI Reference Support
8      @@lang:en      @@lang:en
9    @License: %%GPL%%    @License: %%Perl%%
10    @Author:    @Author:
11      @@Name:      @@Name:
12        @@@@: Wakaba        @@@@: Wakaba
13        @@@lang:ja        @@@lang:ja
14        @@@script:Latn        @@@script:Latn
15      @@Mail[list]: w@suika.fam.cx      @@Mail[list]: w@suika.fam.cx
16    @Date.RCS: $Date$    @Date.RCS:
17    @RequiredModule[list]: URI      $Date$
18      @RequiredModule[list]:
19        main
20        URI
21    @RequiredPlugin[list]: InterWikiCore    @RequiredPlugin[list]: InterWikiCore
22    @Use:    @Use:
23      require URI;      require URI;
# Line 88  FormattingRule: Line 91  FormattingRule:
91                                  (version => $p->{version}+0,                                  (version => $p->{version}+0,
92                                   wiki_uri => $p->{base} ? URI->new ($p->{base})                                   wiki_uri => $p->{base} ? URI->new ($p->{base})
93                                                          : undef,                                                          : undef,
94                                   page => [split m#//#, $p->{page}],                                   page => $o->{wiki}->name ($p->{page}),
95                                   mode => $p->{mode},                                   mode => $p->{mode},
96                                   up_to_date => $p->{up_to_date},                                   up_to_date => $p->{up_to_date},
97  #                                 with_lm => $p->{with_lm},  #                                 with_lm => $p->{with_lm},
# Line 200  FormattingRule: Line 203  FormattingRule:
203          }          }
204          $p->{-result}->query_form (%query);          $p->{-result}->query_form (%query);
205      }      }
206    
207    FormattingRule:
208      @Category[list]: iwc--urireference
209      @Name: iwwe--YukiWikiDBNS-base16-encode
210      @Description:
211        @@@:
212          String encoded in base 16 encoding, with YukiWikiDBNS namespacing
213          rule and suffixes.
214        @@lang: en
215      @Parameter:
216        @@Name: charset
217        @@Type: charset
218        @@Default: "euc-jp"
219        @@Description:
220          @@@@: Charset in which string to be encoded before base 16 applied
221          @@@lang: en
222      @Parameter:
223        @@Name: content
224        @@Type: CDATA
225        @@Default: #REQUIRED
226        @@Description:
227          @@@@: String to be encoded
228          @@@lang: en
229      @Parameter:
230        @@Name: filesystem-namespace-delimiter
231        @@Type: CDATA
232        @@Default: "/"
233        @@Description:
234          @@@@: String with which namespace components to be delimited in result
235          @@@lang: en
236      @Parameter:
237        @@Name: filesystem-namespace-suffix
238        @@Type: CDATA
239        @@Default: ".ns"
240        @@Description:
241          @@@@: String to be suffixed to namespace component in result
242          @@@lang: en
243      @Parameter:
244        @@Name: wiki-namespace-delimiter
245        @@Type: CDATA
246        @@Default: "//"
247        @@Description:
248          @@@@:
249            String by which namespace component in source ("content" parameter)
250            delimited
251          @@@lang: en
252      @Post:
253        my $c = &main::code_convert (\$p->{content}, $p->{charset} || 'euc-jp');
254        $c =~ s/(.)/sprintf '%02X', ord $1/ges;
255        $p->{wiki_namespace_delimiter} ||= $o->{wiki}->{config}->{name}->{space}
256                                             ->{separator};
257        $p->{wiki_namespace_delimiter} =~ s/(.)/sprintf '%02X', ord $1/ges;
258        $p->{filesystem_namespace_delimiter} ||= '/';
259        $p->{filesystem_namespace_suffix} ||= '.ns';
260        $c =~ s{$p->{wiki_namespace_delimiter}}
261               {$p->{filesystem_namespace_suffix}$p->{filesystem_namespace_delimiter}}g;
262        $p->{-result} .= $c . ($p->{filesystem_file_suffix} || '.txt');
263    
264    FormattingRule:
265      @Category[list]: link-to-resource
266      @Name: iwwe--wikiname
267      @Description:
268        @@@: Extracting WikiName from URI reference
269        @@lang: en
270      @Parameter:
271        @@Name: charset
272        @@Type: charset
273        @@Default: (auto)
274        @@Description:
275          @@@: Charset in which WikiName written.
276          @@lang: en
277      @Formatting:
278        if ($INTERWIKICORE->uri_has_feature
279              (uri => $o->{link}->{dest}->{uri},
280               method => 'query')) {
281          my $q = $o->{link}->{dest}->{uri}->query;
282          my $page;
283          my $charset;
284          if ($q and index ($q, '=') > -1) {
285            my %q = map {split /=/, $_, 2} split /[&;]/, $q;
286            $page = $q{mypage};
287            $charset = lc ($q{_charset_} || $q{ie} || $p->{charset})
288                    || $o->{wiki}->{config}->{charset}->{uri_param};
289          } elsif (defined $q and length $q) {
290            $page = $q;
291            $charset = lc $p->{charset}
292                    || $o->{wiki}->{config}->{charset}->{uri_query};
293          }
294          if (defined $page) {
295            $page =~ tr/+/ /;
296            $page =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack 'C', hex $1/ge;
297            $page = &main::code_convert (\$page, $charset);
298            $p->{-parent}->append_text ($page);
299          }
300        }
301    
302    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24