Wiki is a single-page application for browsing and editing content distributed throughout a federation of similar creative-commons licensed sites. What is a federated wiki, and why does federation matter? Authors throughout the federation pull content towards themselves as they edit. With this package authors publish their own edits back to the federation as they edit.
Over the past two years, the Smallest Federated Wiki project has explored the concept and implementation details of the federated wiki concept. This code has been extracted from that project, with the goal of releasing a polished, easy to deploy package.
Learn how to wiki by reading fed.wiki.org
The quickest way to set up wiki on your local machine is to install it globally with npm
:
$ npm install -g wiki
$ wiki
npm update -g
. See Datastore options, below, on how to specify an alternative location.
Visit localhost:3000 to see your wiki. If you choose a host visible to the internet then others in the federation can use your work.
Options for the server can be passed in many ways:
- As command line flags
- As a configuration JSON file specified with --config
- As a config.json file in the root folder or cwd.
- As env vars prefixed with
wiki_
Higher in the list takes precedence. The server will then try to guess all unspecified options.
A number of datastores are supported. Use the --database and --data options to configure, or use the config.json.
The default path to store page data is in a "default-data" subdirectory of the install directory. You can override it like this:
$ wiki --data FILESYSTEM_PATH
The mongodb connection arguments are specified as follows:
$ wiki --database '{"type": "./mongodb", "url": "...", "options": {...}}'
For convenience the url will also be read from MONGO_URI, MONGOLAB_URI, or MONGOHQ_URL. This smooths the Heroku deployment process somewhat.
The mongodb datastore allows for a graceful upgrade path. If a page is not found in mongodb the flatfile datastore will be consulted.
The Redis connection arguments are specified as follows:
$ wiki --database '{"type": "./redis", "host": "...", "port": nnn, "options": {...}}'
The Redis datastore allows for a graceful upgrade path. If a page is not found in redis the flatfile datastore will be consulted.
The leveldb datastore uses JSON encoded leveldb format and is configured by providing a filesystem path:
$ wiki --database '{"type": "./leveldb"}' --data FILESYSTEM_PATH
The leveldb datastore allows for a graceful upgrade path. If a page is not found in leveldb the flatfile datastore will be consulted.
We're enthusiastic about hosting wiki on cloud platform services. There are many alternatives, each with its own strengths and weaknesses. Here we list projects that document procedures for specific services. Look here for ideas about running on your service or roll your own and contribute it here.
- RedHat's OpenShift by @paul90
This package consists of client and server code as well as a number of sample plugins that create special purpose markups that can be used on a paragraph by paragraph basis. Get the code, build the client, and start the server:
$ git clone https://github.com/WardCunningham/wiki.git
$ cd wiki
$ npm install
$ grunt build
$ npm start
While you're coding, you can also watch for files to change. This will rebuild the client each time you save a file.
$ grunt watch
Test the server-side code by running $ grunt test
.
Test the client-side code by starting your wiki server with $npm start
and opening http://localhost:3000/runtests.html
- Join the developer IRC channel,
#fedwiki
on freenode - Stop by the Google Hangout at 10am Pacific every Wednesday
- Submit Issues
- Fork, commit and submit Pull Requests
You may use the Wiki under either the MIT License or the GNU General Public License (GPL) Version 2.