| 1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
|
|
| 3 |
|
|
Plugin: |
| 4 |
|
|
@Name: WikiRead |
| 5 |
|
|
@Description: |
| 6 |
|
|
@@@: Showing WikiPage content |
| 7 |
|
|
@@lang:en |
| 8 |
|
|
@License: %%GPL%% |
| 9 |
|
|
@Author: |
| 10 |
|
|
@@Name: |
| 11 |
|
|
@@@@: Wakaba |
| 12 |
|
|
@@@lang:ja |
| 13 |
|
|
@@@script:Latn |
| 14 |
|
|
@@Mail[list]: [email protected] |
| 15 |
wakaba |
1.2 |
@Date.RCS: $Date: 2003/10/25 06:37:08 $ |
| 16 |
|
|
@RequiredModule[list]: |
| 17 |
|
|
SuikaWiki::SrcFormat |
| 18 |
|
|
@RequiredPlugin[list]: |
| 19 |
|
|
WikiView |
| 20 |
|
|
WikiStruct |
| 21 |
|
|
WikiLinking |
| 22 |
|
|
HTML |
| 23 |
|
|
SuikaWiki09 |
| 24 |
wakaba |
1.1 |
|
| 25 |
|
|
ViewDefinition: |
| 26 |
|
|
@Mode: read |
| 27 |
|
|
@Condition: |
| 28 |
|
|
@@http-method[list]: |
| 29 |
|
|
GET |
| 30 |
|
|
HEAD |
| 31 |
|
|
@Description: |
| 32 |
|
|
@@@: Show WikiPage content as whole |
| 33 |
|
|
@@lang: en |
| 34 |
|
|
@template: |
| 35 |
|
|
@@http-status-code: 200 |
| 36 |
|
|
@@media-type: text/html |
| 37 |
|
|
@@use-media-type-charset: 1 |
| 38 |
|
|
@@expires: %%view%% |
| 39 |
|
|
@@body: |
| 40 |
|
|
%html-document ( |
| 41 |
wakaba |
1.2 |
title => {%res (name => {View:WebPageTitle});}p, |
| 42 |
|
|
link-meta => {%template (name => links);}p, |
| 43 |
wakaba |
1.1 |
content => { |
| 44 |
|
|
%template ( |
| 45 |
|
|
name => ws--page, |
| 46 |
|
|
-content => { |
| 47 |
|
|
%block ( |
| 48 |
|
|
class => 'bodytext', |
| 49 |
wakaba |
1.2 |
content => {%template (name => wr--read-body);}p, |
| 50 |
wakaba |
1.1 |
); |
| 51 |
|
|
}, |
| 52 |
|
|
); |
| 53 |
|
|
}p, |
| 54 |
|
|
); |
| 55 |
|
|
|
| 56 |
wakaba |
1.2 |
ViewFragment: |
| 57 |
|
|
@Template[list]:wr--read-body |
| 58 |
|
|
@Order: 0 |
| 59 |
|
|
@Description: |
| 60 |
|
|
@@@: "Read" mode body -- WikiPage main content |
| 61 |
|
|
@@lang:en |
| 62 |
|
|
@Formatting: |
| 63 |
|
|
%read (comment); |
| 64 |
|
|
|
| 65 |
wakaba |
1.1 |
PluginConst: |
| 66 |
|
|
@NS_XHTML1: |
| 67 |
|
|
http://www.w3.org/1999/xhtml |
| 68 |
|
|
|
| 69 |
|
|
FormattingRule: |
| 70 |
|
|
@Category[list]: view |
| 71 |
|
|
@Name: read |
| 72 |
|
|
@Description: |
| 73 |
|
|
@@@: |
| 74 |
|
|
Show the WikiPage to be "read" |
| 75 |
|
|
@@lang: en |
| 76 |
|
|
@Parameter: |
| 77 |
|
|
@@Name: page |
| 78 |
|
|
@@Type: WikiName |
| 79 |
|
|
@@Default: (current) |
| 80 |
|
|
@@Description: |
| 81 |
|
|
@@@@: WikiPage shown |
| 82 |
|
|
@@@lang:en |
| 83 |
|
|
@Parameter: |
| 84 |
|
|
@@Name: comment |
| 85 |
|
|
@@Type: boolean |
| 86 |
|
|
@@Default: {0} |
| 87 |
|
|
@@Description: |
| 88 |
|
|
@@@@: Append comment form |
| 89 |
|
|
@@@lang:en |
| 90 |
|
|
@Formatting: |
| 91 |
wakaba |
1.2 |
my $page = $p->{page} ? [split $o->{wiki}->{config}->{name}->{space}->{separator_reg}, $p->{page}] : $o->{wiki}->{var}->{page}; |
| 92 |
|
|
my $content = SuikaWiki::SrcFormat->new ($o->{wiki}->{db}->get (content => $page)); |
| 93 |
wakaba |
1.1 |
|
| 94 |
|
|
## TODO: generic (format-independent) comment support |
| 95 |
|
|
$content->{content} .= qq(\n[[#comment]]) |
| 96 |
|
|
if $p->{comment} |
| 97 |
|
|
&& |
| 98 |
|
|
( |
| 99 |
|
|
($content->{type}->[0] eq 'SuikaWiki' && $content->{type}->[1] eq '0.9' && $content->{param}->{obsoleted} ne 'yes') |
| 100 |
|
|
|| |
| 101 |
|
|
(!$content->{type}->[0]) |
| 102 |
|
|
) |
| 103 |
wakaba |
1.2 |
;# && |
| 104 |
|
|
# not $o->_database->meta (IsFrozen => $page); |
| 105 |
wakaba |
1.1 |
|
| 106 |
wakaba |
1.2 |
$r = $content->convert (to => ($p->{to} || 'HTML'), from_default => 'SuikaWiki/0.9', toc => $o->{toc}, page => join ($o->{wiki}->{config}->{name}->{space}->{separator}, $page), p => $p); |
| 107 |
wakaba |
1.1 |
|
| 108 |
|
|
ViewFragment: |
| 109 |
|
|
@Name: links |
| 110 |
|
|
@Description: |
| 111 |
|
|
@@@: Link to read mode of the WikiPage |
| 112 |
|
|
@@lang:en |
| 113 |
|
|
@Formatting: |
| 114 |
|
|
%link-wiki(mode=>read,rel=>view,class=>wiki-cmd, |
| 115 |
|
|
title=>{%res(name=>{Link:View:Description});}p,up-to-date); |
| 116 |
|
|
|
| 117 |
|
|
ViewFragment: |
| 118 |
|
|
@Name: navbar |
| 119 |
|
|
@Description: |
| 120 |
|
|
@@@: Link to read mode of the WikiPage |
| 121 |
|
|
@Order: 0 |
| 122 |
|
|
@Formatting: |
| 123 |
|
|
%anchor-wiki(mode=>read,rel=>view,class=>wiki-cmd, |
| 124 |
|
|
label=>{%res(name=>ViewThisPage);}p, |
| 125 |
|
|
title=>{%res(name=>ViewThisPageLong);}p); |
| 126 |
|
|
|
| 127 |
|
|
Resource: |
| 128 |
|
|
@Link:View:Description: |
| 129 |
|
|
@@@: Show this WikiPage in reading mode |
| 130 |
|
|
@@lang:en |
| 131 |
|
|
@ViewThisPage: |
| 132 |
|
|
@@@: View |
| 133 |
|
|
@@lang:en |
| 134 |
|
|
@ViewThisPageLong: |
| 135 |
|
|
@@@: Show latest version of this WikiPage |
| 136 |
|
|
@@lang:en |
| 137 |
|
|
@View:WebPageTitle: |
| 138 |
|
|
@@@: %page-name; |
| 139 |
|
|
@@lang:en |
| 140 |
|
|
|
| 141 |
|
|
|