/[pub]/suikawiki/script/lib/SuikaWiki/Plugin/WikiRead.wp2
Suika

Contents of /suikawiki/script/lib/SuikaWiki/Plugin/WikiRead.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Oct 25 06:37:08 2003 UTC (22 years, 8 months ago) by wakaba
Branch: MAIN
New plugins

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]: w@suika.fam.cx
15     @Date.RCS: $Date:$
16    
17     ViewDefinition:
18     @Mode: read
19     @Condition:
20     @@http-method[list]:
21     GET
22     HEAD
23     @Description:
24     @@@: Show WikiPage content as whole
25     @@lang: en
26     @template:
27     @@http-status-code: 200
28     @@media-type: text/html
29     @@use-media-type-charset: 1
30     @@expires: %%view%%
31     @@body:
32     %html-document (
33     title => {%res(name=>{View:WebPageTitle});}p,
34     link-meta => {%predefined-template(name=>links);}p,
35     content => {
36     %template (
37     name => ws--page,
38     -content => {
39     %block (
40     class => 'bodytext',
41     content => {%read (comment);}p,
42     );
43     },
44     );
45     }p,
46     );
47    
48     PluginConst:
49     @NS_XHTML1:
50     http://www.w3.org/1999/xhtml
51    
52     FormattingRule:
53     @Category[list]: view
54     @Name: read
55     @Description:
56     @@@:
57     Show the WikiPage to be "read"
58     @@lang: en
59     @Parameter:
60     @@Name: page
61     @@Type: WikiName
62     @@Default: (current)
63     @@Description:
64     @@@@: WikiPage shown
65     @@@lang:en
66     @Parameter:
67     @@Name: comment
68     @@Type: boolean
69     @@Default: {0}
70     @@Description:
71     @@@@: Append comment form
72     @@@lang:en
73     @Formatting:
74     my $page = $p->{page} || $o->{page};
75     my $content = $o->_get_from_database ($page);
76    
77     ## TODO: generic (format-independent) comment support
78     $content->{content} .= qq(\n[[#comment]])
79     if $p->{comment}
80     &&
81     (
82     ($content->{type}->[0] eq 'SuikaWiki' && $content->{type}->[1] eq '0.9' && $content->{param}->{obsoleted} ne 'yes')
83     ||
84     (!$content->{type}->[0])
85     )
86     &&
87     not $o->_database->meta (IsFrozen => $page);
88    
89     $r = $content->convert (to => ($p->{to} || 'HTML'), from_default => 'SuikaWiki/0.9', toc => $o->{toc}, page => $page, p => $p);
90    
91     ViewFragment:
92     @Name: links
93     @Description:
94     @@@: Link to read mode of the WikiPage
95     @@lang:en
96     @Formatting:
97     %link-wiki(mode=>read,rel=>view,class=>wiki-cmd,
98     title=>{%res(name=>{Link:View:Description});}p,up-to-date);
99    
100     ViewFragment:
101     @Name: navbar
102     @Description:
103     @@@: Link to read mode of the WikiPage
104     @Order: 0
105     @Formatting:
106     %anchor-wiki(mode=>read,rel=>view,class=>wiki-cmd,
107     label=>{%res(name=>ViewThisPage);}p,
108     title=>{%res(name=>ViewThisPageLong);}p);
109    
110     Resource:
111     @Link:View:Description:
112     @@@: Show this WikiPage in reading mode
113     @@lang:en
114     @ViewThisPage:
115     @@@: View
116     @@lang:en
117     @ViewThisPageLong:
118     @@@: Show latest version of this WikiPage
119     @@lang:en
120     @View:WebPageTitle:
121     @@@: %page-name;
122     @@lang:en
123    
124    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24