3 wikifs, wikipost \- wiki file system
43 is a web server that facilitates easy editing of the pages it contains.
45 presents a wiki in two forms: as web pages to be served
48 and as text files to be viewed via the
52 .BR /acme/wiki/guide ).
55 presents a file system interface to the wiki data stored
64 flag specifies a different mount point,
71 also announces 9P network services on the addresses
79 will post a service file descriptor in
86 flag causes a transcript of the 9P conversation
87 to be written to standard error.
89 The wiki holds both the current pages and also
90 all versions of all pages that have ever existed.
91 All pages have time stamps associated with them.
92 When a user wants to edit a page, he reads the
93 current page from the wiki, noting the time stamp
95 When a user writes changes to a page, he includes the time stamp
96 of the page he started with. If the page has been updated
97 by someone else while he was editing, the write will fail.
98 This is called a ``conflicting write.''
99 The submission is still saved in the history, so that
100 the user can compare the page he submitted with the changes
101 that were made while he was editing.
103 Each version of each page is described by a text file containing
104 one or more metadata lines followed by the page contents.
105 The metadata lines begin with a capital letter specifying the type of data.
106 Currently the metadata types are:
109 The date this page was written, in decimal seconds since the epoch.
112 The author of this version of the page. Typically the rest of the line
118 This page's contents were submitted but rejected due to a
122 After the metadata comes the actual page contents; each line of
123 page contents is prefixed with a
129 contains all the wiki data. Typically it is world-writable
133 Each page on the wiki has a unique sequence number
137 directory contains three files
144 holds the current version of the page: the first line of
146 is the page title, followed by page metadata and contents as described above.
149 holds the history of the page.
152 is the title of the page.
153 The rest of the file is the metadata and contents of every
154 version of the page that has been submitted to the wiki.
156 is a lock file for the page: it must be
157 held while reading or writing
161 The lock files allow multiple instances of
163 to coexist peacefully.
166 file (with associated lock
168 provides a mapping from
171 Each map line is a decimal
175 Since titles are presented as names by
177 they cannot contain slashes.
180 presents a three-level file system.
181 The top level contains per-page directories
182 named by the page titles with spaces turned
184 Each page also has a number associated with it
185 (see the discussion of the wiki data files below).
186 The number corresponding to a page may
187 also be used to access it, although directory
188 listings will always present the title.
191 file is used to add new or revised pages to the wiki:
192 writes to the file should be in the usual textual format:
193 a title line, metadata lines, and page contents.
194 Once all the contents have been written, a final zero-length
195 message should be written to mark the end of the page.
196 This last write will return an error if a conflicting
198 After writing the file, the client may read from
200 to obtain the canonical title for the page, as presented
203 The page directories contain subdirectories representing
204 the history of the page, named
205 by the decimal time stamp corresponding to each version.
206 In addition to these history directories,
207 the page directories contain the following files:
210 The current raw data file for the page.
213 A web page listing the contents of every version of
214 the page that has ever appeared on the wiki.
215 The text is grey by default:
216 differences between versions appear in black.
219 A web form for editing the current version of the page.
222 A web page listing the time stamps of the historical versions of the page.
223 Each time stamp links to a page showing just
227 A textual formatting of the history. Each time stamp is prefixed with
228 the name of the directory corresponding to that version.
231 An HTML formatting of the current version of the page.
234 A textual formatting of the current version of the page.
237 An HTML error page to be returned by
239 on conflicting writes.
242 The HTML files are generated from the templates with the same names
249 are generated from the templates
254 The history directories
255 are similar to the page directories but only contain
264 are generated from the templates
273 is used to process editing requests posted
274 to the web server by users.
275 It expects the posted form to contain these
276 (usually hidden) fields:
278 the title of the page;
280 the time stamp of the page that is being edited;
282 the service name associated with this wiki
285 .BI /srv/wiki. service \fR);
288 the base for wiki URLs in the response.
290 After mounting the wiki,
292 writes a page update request to
294 and then returns the contents of one HTML
296 .BR /mnt/wiki/ title \fR.
297 If the write succeeds,
301 if the write fails due to a conflicting write,
306 The Plan 9 wiki at Bell Labs is started by running:
309 wikifs -p 666 -s wiki.plan9 -a tcp!*!wiki /sys/lib/wiki
312 The wiki is mounted for
315 .BR /lib/namespace.httpd :
319 mount -b #s/wiki.plan9 /usr/web/wiki/plan9
321 Notice that the wiki service was explicitly posted with
325 would be able to mount it.
327 In the Plan 9 distribution, the directory
329 contains sample files similar to those used
330 to start the current Plan 9 wiki.
332 .B /sys/src/cmd/wikifs
334 .B /sys/src/cmd/ip/httpd/wikipost.c
337 .B http://c2.com/cgi/wiki?WikiWikiWeb