Now this is gonna be my first article in english so please don’t be mad about
that bad spelling ;). So today im going to tell you how to setup moin2.0
Wikiengine for development. Because i had to figure it out myself i thought
its going to be easier for other people if they don’t have to reinvent the
weel once again. Okay now lets start to set things up. First you have to clone
the moin2.0 devel repository it’s hosted on bitbucket so you might have to install
mercurial first. On Debian based machines it works most of the time simply just to
apt-get the mercurial pagacket:
sudo apt-get install mercurial
When this is done you can go ahead and clone the devel repo (you might first want to
change to the directory where you want to clone the repo e.g /home/user/Development):
hg clone ssh://hg@bitbucket.org/thomaswaldmann/moin-2.0
Generating the html doc’s
In my case i had to build the doc’s first because i needed orientation for the Moin2.0
structure and how it works internaly. So i needed to install the sphinx package first
(MoinMoin2.0 uses sphinx documentation builder for doc generation):
sudo apt-get install python-sphinx
in my case it worked out for me so i could go ahead and generate the html doc’s.
The documentation files in the Moin2.0 repo are usually in the „docs“ directory
so you have to go into that directory and type:
make html
This builds the html doc file’s. You could also buld latex documentation and
some other’s, you can give yourself an overview just by typing:
make help
Output:
dirhtml to make HTML files named index.html in directories singlehtml to make a single large HTML file pickle to make pickle files json to make JSON files htmlhelp to make HTML files and a HTML help project qthelp to make HTML files and a qthelp project devhelp to make HTML files and a Devhelp project epub to make an epub latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter latexpdf to make LaTeX files and run them through pdflatex text to make text files man to make manual pages texinfo to make Texinfo files info to make Texinfo files and run them through makeinfo gettext to make PO message catalogs changes to make an overview of all changed/added/deprecated items linkcheck to check all external links for integrity doctest to run all doctests embedded in the documentation (if enabled)
It can take a while to build the docs so be patient. Sphinx might also complains
about missing python libary’s but don’t bother about that, they might not be
nessesary for your development works with Moin. And also the moin2.0 repo comes
with all Core documentation files for generating at least the most important parts
of the documentation.
Setting up Moin2.0 for development
Just run the quickinstall.sh Script in the root of the repository, it takes
a while to get and install all the packages. Thats also because the Script
installes a virtuel environment, so that you can allways just clone the repo
set it up and start writing code. Also all the depencys are setup in the right
way. When the Script is done you can change into the virtual environment simply
by dropping this one:
source env/bin/activate
Your prompt should now look something like this:
(env)cosmo@lazerbeam ~/Development/python/moin-2.0 $
Now you are in the virtual environment and now some commands should be dropped:
moin index-create -s -i
for creating the initial index, otherwise the wiki won’t come up. And for some
initial content:
moin load --file contrib/serialized/items.moin
And finally building the index you just created:
moin index-build
Creating a development Setup
So now i wantet to do an development setup for moin, so i wanted to enable
debugging of course. So i created two new files in the basepath of the repo,
the first file is called „wikiconfig_local.py“ and the second is called
„wikiconfig_editme.py“. The content of wikiconfig_local goes as follows:
from wikiconfig_editme import *
this simply loads the wikiconfig_editme file. The contents of the wikiconfig_editme.py
looks something like this:
from wikiconfig import * #import wikiconfig.py class LocalConfig(Config): configuration_item_1 = 'value1' MOINCFG = LocalConfig DEBUG = True
(Taken from the original wikiconfig.py file). So now we have our development setup
ready we can try to start the local moin development server (usually runs on 127.0.0.1:8080)
Wich is quite easy just run the „moin“ command and the server should come up. Alternatively
you also can pass the moin command the help key word so some help should come up:
$ moin help account_create This command allows you to create a user account account_disable This command allows you to disable user accounts. account_password This command allows you to set a user password. import19 Import data from a moin 1.9 wiki. index-build Build the indexes. index-create Create empty indexes. index-destroy Destroy the indexes. index-dump Dump the indexes in readable form to stdout. index-move Move the indexes from the temporary to the normal location. index-optimize Optimize the indexes. index-update Update the indexes. item-get Get an item revision from the wiki. item-put Put an item revision into the wiki. ...
When you want to start development actively a good starting point in the docs is:
docs/_build/html/devel/development.html
Wich holds all the neccesary information for upcoming devlopers.
Weblinks
MoinMoin Homepage
Moin2.0 Dev repository: http://hg.moinmo.in/moin/2.0
Online docs‘: http://readthedocs.org/docs/moin-20/en/latest/
Issue tracker: http://bitbucket.org/thomaswaldmann/moin-2.0/issues
And for code reviews use http://codereview.appspot.com/