/[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.5 - (show annotations) (download)
Fri Jan 16 07:48:11 2004 UTC (22 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +12 -13 lines
Use WikiFormat module to get format handler

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: 2003/12/01 07:40:32 $
16 @RequiredModule[list]:
17 SuikaWiki::Format::Definition
18 @RequiredPlugin[list]:
19 WikiFormat
20 WikiView
21 WikiStruct
22 WikiLinking
23 HTML
24 SuikaWiki09
25 @Use:
26 require SuikaWiki::Format::Definition;
27 # use Message::Util::Error;
28
29 ViewDefinition:
30 @Mode: read
31 @Condition:
32 @@http-method[list]:
33 GET
34 HEAD
35 @Description:
36 @@@: Show WikiPage content as whole
37 @@lang: en
38 @template:
39 @@http-status-code: 200
40 @@media-type: text/html
41 @@use-media-type-charset: 1
42 @@expires: %%view%%
43 @@body:
44 %html-document (
45 title => {%res (name => {View:WebPageTitle});}p,
46 link-meta => {%template (name => links);}p,
47 content => {
48 %template (
49 name => ws--page,
50 -content => {
51 %block (
52 class => "bodytext",
53 content => {%template (name => wr--read-body);}p,
54 );
55 },
56 );
57 }p,
58 );
59
60 ViewFragment:
61 @Template[list]:wr--read-body
62 @Order: 0
63 @Description:
64 @@@: "Read" mode body -- WikiPage main content
65 @@lang:en
66 @Formatting:
67 %read (comment);
68
69 PluginConst:
70 @NS_XHTML1:
71 http://www.w3.org/1999/xhtml
72
73 FormattingRule:
74 @Category[list]: view
75 @Name: read
76 @Description:
77 @@@:
78 Show the WikiPage to be "read"
79 @@lang: en
80 @Parameter:
81 @@Name: page
82 @@Type: WikiName
83 @@Default: (current)
84 @@Description:
85 @@@@: WikiPage shown
86 @@@lang:en
87 @Parameter:
88 @@Name: comment
89 @@Type: boolean
90 @@Default: {0}
91 @@Description:
92 @@@@: Append comment form
93 @@@lang:en
94 @Formatting:
95 __ATTRTEXT:%page__;__ATTRTEXT:%comment__;
96 ## TODO: pagename
97 my $page = $p->{page} ?
98 [split $o->{wiki}->{config}->{name}->{space}->{separator_reg},
99 $p->{page}] :
100 $o->{wiki}->{var}->{page};
101 my $content = $o->{wiki}->{db}->get (content => $page);
102
103 my $format = SuikaWiki::Plugin->module_package ('WikiFormat')
104 ->handler (\$content,
105 o => $o, wiki => $o->{wiki});
106 $format->convert (\$content, Type => 'text/html',
107 IsFragment => 1, -parent => $p->{-parent},
108 o => $o, page => $page);
109
110 ## TODO: generic (format-independent) comment support
111
112 ViewFragment:
113 @Name: links
114 @Description:
115 @@@: Link to read mode of the WikiPage
116 @@lang:en
117 @Formatting:
118 %link-wiki(mode=>read,rel=>view,class=>wiki-cmd,
119 description=>{%res(name=>{Link:View:Description});}p,up-to-date);
120
121 ViewFragment:
122 @Name: navbar
123 @Description:
124 @@@: Link to read mode of the WikiPage
125 @Order: 0
126 @Formatting:
127 %link-to-wikipage (
128 rel => view,
129 mode => read,
130 up-to-date,
131 label => {%link-to-it (
132 class => wiki-cmd,
133 label => {%res(name=>ViewThisPage);}p,
134 description => {%res(name=>ViewThisPageLong);}p,
135 );},
136 );
137
138 Resource:
139 @Link:View:Description:
140 @@@: Show this WikiPage in reading mode
141 @@lang:en
142 @ViewThisPage:
143 @@@: View
144 @@lang:en
145 @ViewThisPageLong:
146 @@@: Show latest version of this WikiPage
147 @@lang:en
148 @View:WebPageTitle:
149 @@@: %page-name;
150 @@lang:en
151
152

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24