You are looking at historical revision 18702 of this page. It may differ significantly from its current revision.
A fast and light-weight wiki
qwiki is the "quick wiki". It is a lightweight wiki which uses sxml for internal wiki page representation. Because it uses sxml as intermediate representation, it is easy to write different output generators through the use of multidoc.
In the future we also hope to support multiple storage backends but right now subversion is the only implementation of that.
How to set it up
Set up hyper-estraier
You should set up a Hyper Estraier server. This is as simple as navigating to the directory under which you want the database to be created and entering the following commands:
# estmaster init estraierdb # estmaster start estraierdb
This creates the db and sets the server running.
Later, if you are happy with the setup and the wiki is working properly, you can add this line to your startup scripts:
estmaster start -bg /path/to/estraierdb
The -bg switch puts it into daemon mode (and makes it quiet).
Create a subversion repository
You should first create a subversion repository, if you don't already have one. Then, make a post-commit-hook script that invokes qwiki-post-commit with as its first argument the repository location and second the newly created revision (currently unused):
#!/bin/sh # The path to the web root where the cached HTML files will be placed export QWIKI_WEB_PATH=/var/www/html/qwiki # The place where you have the checkout of this repository export QWIKI_SOURCE_PATH=/var/www/private-data/qwiki-checkout # An URL pointing at the estraier server set up in the previous step export QWIKI_SEARCH_URI=http://admin:admin@localhost:1978 /usr/local/bin/qwiki-post-commit $@
If you prefer, you can delay setting up the post-commit-hook until after you got the wiki up and running (this is a good idea if people will be committing to the repository while you are setting this up).
Run the installation script
Now you are ready to run the qwiki installation script which will create an initial checkout, process all files to make a cached HTML file and create populate the search index.
# qwiki-install <repos-uri> <checkout-path> <web-path>
- the URI for the subversion repository from where a copy can be checked out
- the path to where the checkout of the repository will be stored
- the path used by the web-server to serve wiki pages
<checkout-path> and <web-path> should not overlap.
The exact directory locations are up to you, of course, but they will have to match the locations of the post-commit-hook. You can also set the search URI location through the QWIKI_SEARCH_URI environment variable if you changed the default admin account or want it to use some other location than localhost.
Create a spiffy configuration
Currently qwiki can only run under Spiffy, so you will either have to run spiffy as your main webserver, or proxy all requests for the wiki to it.
(use spiffy qwiki qwiki-nowiki qwiki-search qwiki-menu qwiki-svn) ;; If you don't want these extensions, remove them from this script (nowiki-install!) (search-install!) (menu-install!) (qwiki-repos-uri "file:///path/to/repos") ;; Ensure this is an absolute path, if you are using Chicken 4.1 or earlier (root-path "/var/www/html/qwiki") ;; Pass all requests to non-existent files through qwiki: (vhost-map `((".*" . ,(lambda (continue) (parameterize ((handle-not-found qwiki-handler) (handle-directory qwiki-handler) (index-files '())) (continue)))))) (start-server)
When you run this, your qwiki installation should be available at http://localhost:8080
Customizing Qwiki[parameter] (qwiki-css-file [FILE])
Set an optional CSS file to use for styling the wiki. FILE should be a string, which is parsed into an uri-common object by the uri-reference procedure. This URI should be relative to the docroot. Defaults to #f.[parameter] (qwiki-title [TITLE])
Set an optional global TITLE or "name" for the wiki. This will appear on every page in the browser's titlebar to inform the user that he's on a page of this particular wiki. Defaults to #f.[parameter] (qwiki-source-path [DIRECTORY])
The directory where qwiki expects a checkout of the repository that holds the wiki pages. When running the installation procedure, it will make this checkout.
The value defaults to the environment variable QWIKI_SOURCE_PATH if set. Otherwise it will default to "/tmp/qwiki".[parameter] (qwiki-web-path [DIRECTORY])
The directory where qwiki will write its generated and cached HTML files to. Defaults to the environment variable QWIKI_WEB_PATH if set, otherwise will default to "/var/www".
This variable is only for when qwiki is called from the commandline or through the post-commit hook. It is ignored when running qwiki through qwiki-handler inside Spiffy. In that case it will just use Spiffy's root-path.[parameter] (qwiki-docroot [DIRECTORY])
In case you want qwiki be accessible underneath a subdirectory of spiffy, you can use this. (it's unsure whether this even works and whether it will stay)[parameter] (qwiki-base-uri [URI])
The URI (an uri-common object) under which this wiki is available. All internal links will use this as their base URI. Defaults to /.[parameter] (qwiki-output-driver [TRANSFORMATION-RULES])
This defaults to qwiki-html-transformation-rules from the qwiki-sxml module. It can be changed to qwiki-LaTeX-transformation-rules or qwiki-Texinfo-transformation-rules when generating offline documentation.[parameter] (qwiki-extensions [EXTENSIONS])
This parameter can be extended to add transformation rule extensions to the output driver. Defaults to the empty list.
A transformation rule is simply a ruleset accepted by pre-post-order*.[parameter] (qwiki-update-handlers [HANDLERS])
This parameter can be extended to add update callbacks which will be invoked when a wiki page was updated. Defaults to the empty list.
An update hook is a procedure that accepts a path to the wiki page (a list of path components) and the sxml which represents the new contents.[parameter] (qwiki-delete-handlers [HANDLERS])
This parameter can be extended to add update callbacks which will be invoked when a wiki page was removed. Defaults to the empty list.[parameter] (blocked-ip-addresses-file [PATH])
A path relative to the qwiki checkout which points to a file containing IP addresses to be blocked, one address per line. Useful for combating spam.
Defaults to "edit-deny".[parameter] (qwiki-current-file [PATH])
Not to be touched in the configuration; this is a run-time parameter used to indicate the current wiki file being processed. Useful for use in transformation rules.
- trunk - no release yet
Copyright (c) 2009-2010, Ivan Raikov and Peter Bex All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.