#?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: 2004/01/16 07:48:11 $ @RequiredModule[list]: SuikaWiki::Format::Definition @RequiredPlugin[list]: WikiFormat WikiView WikiStruct WikiLinking HTML SuikaWiki09 @Use: require SuikaWiki::Format::Definition; # use Message::Util::Error; 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: __ATTRTEXT:%page__;__ATTRTEXT:%comment__; ## TODO: pagename my $page = $p->{page} ? [split $o->{wiki}->{config}->{name}->{space}->{separator_reg}, $p->{page}] : $o->{wiki}->{var}->{page}; my $content = $o->{wiki}->{db}->get (content => $page); my $format = SuikaWiki::Plugin->module_package ('WikiFormat') ->handler (\$content, o => $o, wiki => $o->{wiki}); $format->convert (\$content, Type => 'text/html', IsFragment => 1, -parent => $p->{-parent}, o => $o, page => $page); ## TODO: generic (format-independent) comment support ViewFragment: @Name: links @Description: @@@: Link to read mode of the WikiPage @@lang:en @Formatting: %link-wiki(mode=>read,rel=>view,class=>wiki-cmd, description=>{%res(name=>{Link:View:Description});}p,up-to-date); ViewFragment: @Name: navbar @Description: @@@: Link to read mode of the WikiPage @Order: 0 @Formatting: %link-to-wikipage ( rel => view, mode => read, up-to-date, label => {%link-to-it ( class => wiki-cmd, label => {%res(name=>ViewThisPage);}p, description => {%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