#?SuikaWikiConfig/2.0 Plugin: @Name: WikiRead @Description: @@@: Showing WikiPage content @@lang:en @License: %%GPL%% @Author: @@Name: @@@@: Wakaba @@@lang:ja @@@script:Latn @@Mail[list]: w@suika.fam.cx @Date.RCS: $Date: 2003/10/30 07:45:10 $ @RequiredModule[list]: SuikaWiki::SrcFormat @RequiredPlugin[list]: WikiView WikiStruct WikiLinking HTML SuikaWiki09 ViewDefinition: @Mode: read @Condition: @@http-method[list]: GET HEAD @Description: @@@: Show WikiPage content as whole @@lang: en @template: @@http-status-code: 200 @@media-type: text/html @@use-media-type-charset: 1 @@expires: %%view%% @@body: %html-document ( title => {%res (name => {View:WebPageTitle});}p, link-meta => {%template (name => links);}p, content => { %template ( name => ws--page, -content => { %block ( class => 'bodytext', content => {%template (name => wr--read-body);}p, ); }, ); }p, ); ViewFragment: @Template[list]:wr--read-body @Order: 0 @Description: @@@: "Read" mode body -- WikiPage main content @@lang:en @Formatting: %read (comment); PluginConst: @NS_XHTML1: http://www.w3.org/1999/xhtml FormattingRule: @Category[list]: view @Name: read @Description: @@@: Show the WikiPage to be "read" @@lang: en @Parameter: @@Name: page @@Type: WikiName @@Default: (current) @@Description: @@@@: WikiPage shown @@@lang:en @Parameter: @@Name: comment @@Type: boolean @@Default: {0} @@Description: @@@@: Append comment form @@@lang:en @Formatting: my $page = $p->{page} ? [split $o->{wiki}->{config}->{name}->{space}->{separator_reg}, $p->{page}] : $o->{wiki}->{var}->{page}; my $content = SuikaWiki::SrcFormat->new ($o->{wiki}->{db}->get (content => $page)); ## TODO: generic (format-independent) comment support $content->{content} .= qq(\n[[#comment]]) if $p->{comment} && ( ($content->{type}->[0] eq 'SuikaWiki' && $content->{type}->[1] eq '0.9' && $content->{param}->{obsoleted} ne 'yes') || (!$content->{type}->[0]) ) ;# && # not $o->_database->meta (IsFrozen => $page); $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); ViewFragment: @Name: links @Description: @@@: Link to read mode of the WikiPage @@lang:en @Formatting: %link-wiki(mode=>read,rel=>view,class=>wiki-cmd, title=>{%res(name=>{Link:View:Description});}p,up-to-date); ViewFragment: @Name: navbar @Description: @@@: Link to read mode of the WikiPage @Order: 0 @Formatting: %anchor-wiki(mode=>read,rel=>view,class=>wiki-cmd, label=>{%res(name=>ViewThisPage);}p, title=>{%res(name=>ViewThisPageLong);}p); Resource: @Link:View:Description: @@@: Show this WikiPage in reading mode @@lang:en @ViewThisPage: @@@: View @@lang:en @ViewThisPageLong: @@@: Show latest version of this WikiPage @@lang:en @View:WebPageTitle: @@@: %page-name; @@lang:en