| 1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
|
|
| 3 |
|
|
Plugin: |
| 4 |
|
|
@Name: WikiFormat |
| 5 |
|
|
@Description: |
| 6 |
|
|
@@@: WikiFormat - format independent proceding |
| 7 |
|
|
@@lang:en |
| 8 |
wakaba |
1.4 |
@License: %%Perl%% |
| 9 |
wakaba |
1.1 |
@Author: |
| 10 |
|
|
@@Name: |
| 11 |
|
|
@@@@: Wakaba |
| 12 |
|
|
@@@lang:ja |
| 13 |
|
|
@@@script:Latn |
| 14 |
|
|
@@Mail[list]: [email protected] |
| 15 |
wakaba |
1.4 |
@Date.RCS: |
| 16 |
|
|
$Date: 2004/02/08 08:52:03 $ |
| 17 |
wakaba |
1.1 |
@RequiredPackage[list]: |
| 18 |
|
|
Error |
| 19 |
|
|
|
| 20 |
|
|
PluginConst: |
| 21 |
|
|
@NS_XHTML1: |
| 22 |
|
|
http://www.w3.org/1999/xhtml |
| 23 |
|
|
|
| 24 |
|
|
Function: |
| 25 |
|
|
@Name: handler |
| 26 |
|
|
@Description: |
| 27 |
|
|
@@@: |
| 28 |
|
|
Getting format handler for given data |
| 29 |
|
|
@@lang:en |
| 30 |
|
|
@Main: |
| 31 |
|
|
my (undef, $content, %opt) = @_; |
| 32 |
|
|
## TODO: check content__media_type |
| 33 |
|
|
|
| 34 |
|
|
my ($magic) = $opt{magic} |
| 35 |
|
|
|| ($$content =~ m[^(?:\#\?|/\*\s*)([\w.+-]+(?:/[\w.+-]+)?)]); |
| 36 |
|
|
my @type = $magic ? (magic => $magic) : |
| 37 |
|
|
(Type => 'text/x-suikawiki', |
| 38 |
|
|
Type_param => {version => '0.9'}); |
| 39 |
|
|
my $def = SuikaWiki::Format::Definition->new_handler (@type, -error => sub { |
| 40 |
|
|
my ($err) = @_; |
| 41 |
|
|
SuikaWiki::Plugin->module_package ('Error') |
| 42 |
wakaba |
1.3 |
->report_error_simple ($opt{wiki} ||= $opt{o}->{wiki}, |
| 43 |
wakaba |
1.2 |
SuikaWiki::Plugin |
| 44 |
|
|
->module_package ('WikiResource') |
| 45 |
|
|
->get (name => 'WikiFormat:Error:Type=WikiFormat', |
| 46 |
|
|
wiki => $opt{wiki} || |
| 47 |
|
|
$opt{o}->{wiki}, |
| 48 |
|
|
o => $opt{o}) |
| 49 |
wakaba |
1.3 |
=> $err->text, |
| 50 |
|
|
-trace => $opt{wiki}->{config} |
| 51 |
wakaba |
1.4 |
->{debug}->{format}); |
| 52 |
wakaba |
1.1 |
}); |
| 53 |
|
|
$def->{wiki} = $opt{wiki} || $opt{o}->{wiki}; |
| 54 |
|
|
$def->{view} = $def->{wiki}->{view}; |
| 55 |
|
|
$def; |
| 56 |
wakaba |
1.2 |
|
| 57 |
wakaba |
1.3 |
ViewDefinition: |
| 58 |
|
|
@Mode: -wf--converter-not-found |
| 59 |
|
|
@Condition: |
| 60 |
|
|
@@http-method[list]: |
| 61 |
|
|
GET |
| 62 |
|
|
HEAD |
| 63 |
|
|
POST |
| 64 |
|
|
@Description: |
| 65 |
|
|
@@@: Converter to requested media type not found |
| 66 |
|
|
@@lang: en |
| 67 |
|
|
@template: |
| 68 |
|
|
@@http-status-code: 406 |
| 69 |
|
|
@@http-status-phrase: Converter Not Found |
| 70 |
|
|
@@media-type: text/html |
| 71 |
|
|
@@use-media-type-charset: 1 |
| 72 |
|
|
@@expires: %%error%% |
| 73 |
|
|
@@body: |
| 74 |
|
|
%html-document ( |
| 75 |
|
|
title => {%res (name => {WikiFormat:NoConverter:WebPageTitle});}p, |
| 76 |
|
|
link-meta => {%template (name => links);}p, |
| 77 |
|
|
content => { |
| 78 |
|
|
%block (id => tools1, class => tools, |
| 79 |
|
|
content => {%template (name => navbar);}p); |
| 80 |
|
|
%section ( |
| 81 |
|
|
title => {%res (name => {WikiFormat:NoConverter:Title});}p, heading, |
| 82 |
|
|
content => {%paragraph ( |
| 83 |
|
|
content => {%res (name => {WikiFormat:NoConverter:Description});}p, |
| 84 |
|
|
);%error-list ( |
| 85 |
|
|
no-error => {%res (name => {Error:NoErrorReported});}p, |
| 86 |
|
|
);}p, |
| 87 |
|
|
); |
| 88 |
|
|
%block (id => footer, content => {%template (name => ws--footer);}p); |
| 89 |
|
|
}p, |
| 90 |
|
|
); |
| 91 |
|
|
|
| 92 |
wakaba |
1.2 |
Resource: |
| 93 |
|
|
@WikiFormat:Error:Type=WikiFormat: |
| 94 |
|
|
@@@: WikiFormat |
| 95 |
wakaba |
1.3 |
@@lang: en |
| 96 |
|
|
@WikiFormat:NoConverter:Description: |
| 97 |
|
|
@@@: |
| 98 |
|
|
Converter to media type requested not found, so that your |
| 99 |
|
|
request cannot be completed. |
| 100 |
|
|
@@lang: en |
| 101 |
|
|
@WikiFormat:NoConverter:Title: |
| 102 |
|
|
@@@: Converter Not Found |
| 103 |
|
|
@@lang: en |
| 104 |
|
|
@WikiFormat:NoConverter:WebPageTitle: |
| 105 |
|
|
@@@: 406 Converter Not Found |
| 106 |
wakaba |
1.2 |
@@lang: en |
| 107 |
|
|
|
| 108 |
wakaba |
1.1 |
|