The extra rock adds an alternative text-processor (or rather a bridge to Hisham's Medialike library) and alternative templates that are designed to mimic the current design of LuaUsers.
The Demos
- "I Can't Believe it's Not LuaUsers Wiki" (by Jérôme Vuarand) 404!
- Sputnik's original look and feel (but with the LU content and using LU markup) 404!
To avoid getting the pages spidered by google, there is a .htaccess authentication for the whole directory. Login as "lua" with password "wiki".)
Note that it's actually the same Sputnik installation, just with two
different cgi files, which differ by two characters: the one for wiki2
has ROOT_PROTOTYPE = '@LuaUsers' commented out.
Both demos use the original LuaWiki markup format, with almost all of its features supported. This is done by relying on Hisham Muhammad's Medialike library, which implements another dialect of UseMod markup.
The Code
You can browse the code of the rock that contains the modification. It's just three files.
Setting It up Yourself
If you want to make your Sputnik look like LuaUsers, it's actually quite easy. You just need to install a rock and set two config values. If you later change your mind, just undo the configuration. (And un-install the rock if you want to save a few kilobytes.)
Install Sputnik as usually
mkdir ~/sputnik
cd ~/sputnik -- any other directory should work
wget http://sputnik.freewisdom.org/files/sputnik_install_2008_02_16.sh
sh sputnik_install_2008_02_16.sh
(Note: this installs a February 16, 2008 release of Sputnik, which is what we tested those rocks with. If you want, you can try following the instructions on Installation to install the latest Sputnik instead and see if this would still work.)
Install the "sputnik-luausrs" rock
./bin/luarocks install sputnik-luausers
Tell Sputnik to use the alternative nodes
Edit htdocs/sputnik.lua and adding the following lines fields to SPUTNIK_CONFIG:
MARKUP_MODULE = 'sputnik.markup.luausers',
ROOT_PROTOTYPE = '@LuaUsers',
E.g., the cgi file used in the demo looks as follows:
#! /home2/yuri/sputnik/luausers/bin/lua5.1
require'luarocks.require'
require'wsapi.cgi'; require'sputnik'
SPUTNIK_CONFIG = {
VERSIUM_PARAMS = { dir = '/home2/yuri/sputnik/luausers/wiki-data' },
BASE_URL = '/luausers/wiki.cgi',
NICE_URL = '/luausers/wiki/',
MARKUP_MODULE = 'sputnik.markup.luausers',
ROOT_PROTOTYPE = '@LuaUsers'
}
wsapi.cgi.run(sputnik.wsapi_run)
Note that if you uncomment the ROOT_PROTOTYPE line you get LuaUsers markup
support but with the original Sputnik skin.
Load the data
wget http://media.freewisdom.org/tmp/lua-users-content.zip
unzip lua-users-content.zip
wget http://media.freewisdom.org/tmp/import_from_luausers.lua
./bin/lua5.1 import_from_luausers.lua lua-users-content/nodes/ wiki-data/
Run
./bin/lua5.1 ./bin/xavante_start
Then visit http://localhost:8080/sputnik.lua?p=HomePage
If you want to HomePage to show up as the default page instead of "HomePage", edit the "config" node.
Not supported at the moment
- search (FindPage)
- syntax highlighting of Lua code
- backlinks
- preference page
- reference-style formatting for external links
- special links links like
[LuaList:2008-02/msg00363.html]
Things that work a little different but are probably not worth changing
- history (the diff method)
- preview allow further editing
Comments?
Leave your comments here.