/[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.3 - (show annotations) (download)
Tue Nov 25 12:38:22 2003 UTC (22 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.2: +27 -21 lines
Use new WikiPlugin formatting interface

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/10/30 07:45:10 $
16 @RequiredModule[list]:
17 SuikaWiki::Format::Definition
18
19 SuikaWiki::SrcFormat
20 @RequiredPlugin[list]:
21 WikiView
22 WikiStruct
23 WikiLinking
24 HTML
25 SuikaWiki09
26 @Use:
27 require SuikaWiki::Format::Definition;
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} ? [split $o->{wiki}->{config}->{name}->{space}->{separator_reg}, $p->{page}] : $o->{wiki}->{var}->{page};
98 my $content = $o->{wiki}->{db}->get (content => $page);
99 my $format = SuikaWiki::Format::Definition->new_handler
100 (Type => 'text/x-suikawiki',
101 Type_param => {version => '0.9'});
102 $format->convert ($content, Type => 'text/html',
103 IsFragment => 1, -parent => $p->{-parent});
104
105 ## TODO: generic (format-independent) comment support
106
107 ViewFragment:
108 @Name: links
109 @Description:
110 @@@: Link to read mode of the WikiPage
111 @@lang:en
112 @Formatting:
113 %link-wiki(mode=>read,rel=>view,class=>wiki-cmd,
114 description=>{%res(name=>{Link:View:Description});}p,up-to-date);
115
116 ViewFragment:
117 @Name: navbar
118 @Description:
119 @@@: Link to read mode of the WikiPage
120 @Order: 0
121 @Formatting:
122 %link-to-wikipage (
123 rel => view,
124 mode => read,
125 up-to-date,
126 label => {%link-to-it (
127 class => wiki-cmd,
128 label => {%res(name=>ViewThisPage);}p,
129 description => {%res(name=>ViewThisPageLong);}p,
130 );},
131 );
132
133 Resource:
134 @Link:View:Description:
135 @@@: Show this WikiPage in reading mode
136 @@lang:en
137 @ViewThisPage:
138 @@@: View
139 @@lang:en
140 @ViewThisPageLong:
141 @@@: Show latest version of this WikiPage
142 @@lang:en
143 @View:WebPageTitle:
144 @@@: %page-name;
145 @@lang:en
146
147

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24