| 1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
| 3 |
Plugin: |
| 4 |
@Name: InterWikiForSpecifications |
| 5 |
@Description: |
| 6 |
@@@: |
| 7 |
InterWiki - Technical Specifications such as W3C Recommendations |
| 8 |
@@lang:en |
| 9 |
@License: %%Perl%% |
| 10 |
@Author: |
| 11 |
@@Name: |
| 12 |
@@@@: Wakaba |
| 13 |
@@@lang:ja |
| 14 |
@@@script:Latn |
| 15 |
@@Mail[list]: [email protected] |
| 16 |
@Date.RCS: |
| 17 |
$Date: 2004/03/10 06:57:25 $ |
| 18 |
@RequiredModule[list]: |
| 19 |
URI |
| 20 |
@RequiredPlugin[list]: InterWikiCore |
| 21 |
@Use: |
| 22 |
require URI; |
| 23 |
use Message::Util::Error; |
| 24 |
@Namespace: |
| 25 |
@@iws: |
| 26 |
http://suika.fam.cx/~wakaba/archive/2004/8/6/iw-spec# |
| 27 |
|
| 28 |
FormattingRule: |
| 29 |
@Category[list]: |
| 30 |
link-to-resource |
| 31 |
view-resource |
| 32 |
@Name: iws--path |
| 33 |
@Description: |
| 34 |
@@lang:en |
| 35 |
@@@: "Path" extracted by "iws--select-w3c-dom". |
| 36 |
@Formatting: |
| 37 |
$p->{-parent}->append_text ($o->{iwc__param}->{<Q:iws:path>}); |
| 38 |
|
| 39 |
FormattingRule: |
| 40 |
@Category[list]: |
| 41 |
link-to-resource |
| 42 |
view-resource |
| 43 |
@Name: iws--module |
| 44 |
@Description: |
| 45 |
@@lang:en |
| 46 |
@@@: "Module" extracted by "iws--select-w3c-dom". |
| 47 |
@Formatting: |
| 48 |
$p->{-parent}->append_text ($o->{iwc__param}->{<Q:iws:module>}); |
| 49 |
|
| 50 |
FormattingRule: |
| 51 |
@Category[list]: link-to-resource |
| 52 |
@Name: iws--select-w3c-dom |
| 53 |
@Description: |
| 54 |
@@@: |
| 55 |
"Select" for W3C DOM Specifications (Level 2 or higher) |
| 56 |
@@lang:en |
| 57 |
@Parameter: |
| 58 |
@@Name: path |
| 59 |
@@Type: |
| 60 |
uri:path |
| 61 |
@@Default: "Core/" |
| 62 |
@@Description: |
| 63 |
@@@lang:en |
| 64 |
@@@@: Link to. Example: "Core/core.html". |
| 65 |
@Parameter: |
| 66 |
@@Name: SCHEMENAME |
| 67 |
@@Type: |
| 68 |
template |
| 69 |
@@Default:(none) |
| 70 |
@@Description: |
| 71 |
@@@@: Template used when scheme name is SCHEMENAME |
| 72 |
@@@lang:en |
| 73 |
@Parameter: |
| 74 |
@@Name: otherwise |
| 75 |
@@Type: |
| 76 |
template |
| 77 |
@@Default:(none) |
| 78 |
@@Description: |
| 79 |
@@@@: Template used when no SCHEMENAME parameter matches |
| 80 |
@@@lang:en |
| 81 |
@Formatting: |
| 82 |
my ($module, $path) = ('Core', ''); |
| 83 |
__ATTRTEXT:%path__; |
| 84 |
if ($p->{path} =~ m#(\w[^/]+)/(.+)#) { |
| 85 |
$module = $1; |
| 86 |
$path = $2; |
| 87 |
} |
| 88 |
(my $module2 = $module) =~ tr/-/_/; |
| 89 |
local $o->{iwc__param}->{<Q:iws:module>} = $module; |
| 90 |
local $o->{iwc__param}->{<Q:iws:path>} = $path; |
| 91 |
|
| 92 |
my $rule; |
| 93 |
if (defined $p->{$module2}) { |
| 94 |
$rule = __ATTRTEXT:%{$module2}__; |
| 95 |
} else { |
| 96 |
$rule = __ATTRTEXT:%otherwise__; |
| 97 |
} |
| 98 |
|
| 99 |
try { |
| 100 |
$f->replace ($rule, param => $o, -parent => $p->{-parent}); |
| 101 |
} catch Message::Util::Formatter::error with { |
| 102 |
my $err = shift; |
| 103 |
if ($err->{-object}->{-category_name} eq $f->{-category_name}) { |
| 104 |
my $wiki = $err->{option}->{param}->{wiki}; |
| 105 |
__FUNCPACK{Error}__->reporting_formatting_template_error |
| 106 |
($err, $wiki, |
| 107 |
template => $rule); |
| 108 |
} else { |
| 109 |
$err->throw; |
| 110 |
} |
| 111 |
}; |