1 This tutorial will walk you through setting up a wiki with ikiwiki.
5 ## [[Download]] and [[install]] ikiwiki.
7 If you're using Debian or Ubuntu, ikiwiki is an `apt-get install ikiwiki` away.
8 If you're not, see the [[download]] and [[install]] pages.
10 ## Decide where your wiki's files will go.
12 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
13 and outputs the files to a destination directory. If you keep your wiki in
14 a version control system, the source directory will contain a working copy
15 checked out from the version control system.
17 For the purposes of this tutorial, we'll set shell variables
18 for these locations, and use those variables in the commands that follow.
21 DESTDIR=~/public_html/wiki/
23 Note that ikiwiki owns the working copy directory; do not perform your own
24 edits in ikiwiki's working copy.
26 ## Create the beginnings of your wiki.
28 This will create a simple main page for the wiki.
34 In the editor, you could start by entering a simple page like
35 [[!toggle id=page text="this one"]].
36 [[!toggleable id=page text="""
37 Welcome to your new wiki.
39 All wikis are supposed to have a \[[SandBox]],
44 This wiki is powered by [ikiwiki](http://ikiwiki.info).
47 See [[ikiwiki/formatting]] for details about the markup language.
49 Note that several [[standard_wiki_pages|basewiki]] will be added to your
50 wiki, from files in `/usr/share/ikiwiki/basewiki/`, so your wiki will
51 automatically get a [[SandBox]], and some other useful pages.
53 ## Build your wiki for the first time.
55 ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
57 Replace the url with the real url to your wiki. You should now
58 be able to visit the url and see your wiki.
60 ## Add content to your wiki.
62 Continue editing or adding pages and rebuilding the wiki.
64 To quickly get started on a common task like blogging with ikiwiki, you
65 can copy in files from the [[examples]]. The examples are located in
66 `doc/examples/` in the ikiwiki source package.
68 You can experiment with other ikiwiki parameters such as `--wikiname`
69 and `--rebuild` too. Get comfortable with its command line (see
74 By now you should be getting tired of typing in all the command line
75 options each time you change something in your wiki's setup. Time to
76 introduce setup files.
78 To generate a setup file, use `ikiwiki --dumpsetup`. You can pass
79 all the options have you been including at the command line, and they
80 will be stored in the setup file.
82 ikiwiki $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/ --dumpsetup ikiwiki.setup
84 Note that this file should *not* be put in your wiki's directory with
85 the rest of the files. A good place to put it is in a ~/.ikiwiki/
88 Most of the options, like `wikiname` in the setup file are the same as
89 ikiwiki's command line options (documented in [[usage]]. `srcdir` and
90 `destdir` are the two directories you specify when running ikiwiki by
91 hand. Make sure that these are pointing to the right directories, and
92 read through and configure the rest of the file to your liking.
94 When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
95 will set everything up.
97 ## Turn on additional features.
99 Now you have a basic wiki with a setup file. Time to experiment
100 with ikiwiki's many features.
102 Let's first enable a key wiki feature and set up [[CGI]] to allow
103 editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
104 block for the cgi wrapper, make sure the filename for the cgi wrapper
105 is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
107 There are lots of other configuration options in ikiwiki.setup that you
108 can uncomment, configure, and enable by re-running
109 `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
112 ## Put your wiki in revision control.
114 At this point you might want to check your wiki in to a revision control
115 system so you can keep track of changes and revert edits. Depending
116 on the revision control system you choose, the way this is done varies.
118 Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and
119 should be preserved, but not checked into revision control.
121 The [[ikiwiki-makerepo]] command automates setting up a wiki in
124 [[!toggle id=subversion text="Subversion"]]
125 [[!toggleable id=subversion text="""
126 REPOSITORY=~/wikirepo
127 ikiwiki-makerepo svn $SRCDIR $REPOSITORY
130 [[!toggle id=git text="Git"]]
131 [[!toggleable id=git text="""
132 REPOSITORY=~/wiki.git
133 ikiwiki-makerepo git $SRCDIR $REPOSITORY
135 Please see [[rcs/git]] for detailed documentation about how
136 ikiwiki uses git repositories, and some important caveats
137 about using the git repositories.
140 [[!toggle id=mercurial text="Mercurial"]]
141 [[!toggleable id=mercurial text="""
143 ikiwiki-makerepo mercurial $SRCDIR
146 [[!toggle id=bazaar text="Bazaar"]]
147 [[!toggleable id=bazaar text="""
149 ikiwiki-makerepo bzr $SRCDIR
152 [[!toggle id=tla text="TLA"]]
153 [[!toggleable id=tla text="""
154 REPOSITORY=~/wikirepo
155 tla make-archive me@localhost--wiki $REPOSITORY
156 tla my-id "<me@localhost>"
158 tla archive-setup me@localhost--wiki/wiki--0
159 tla init-tree me@localhost--wiki/wiki--0
160 # Edit {arch}/=tagging-method and change the precious
161 # line to add the .ikiwiki directory to the regexp.
166 [[!toggle id=monotone text="Monotone"]]
167 [[!toggleable id=monotone text="""
168 # These instructions are standard instructions to import a directory into monotone
169 # and set it up so that you don't need any passwords to use it
170 REPOSITORY=~/.ikiwiki/mtn.db
171 BRANCH=com.company.wikiname
172 # remember the password you use in the next step and
173 # substitute it for 'wikiKeyPass' in the get_passphrase() hook below
174 # note the you should never generate two monotone keys with the same name
175 mtn genkey web@example.com
176 mtn db init --db=$REPOSITORY
177 mv $SRCDIR $SRCDIR-old
179 echo ".ikiwiki" > $SRCDIR-old/.mtn-ignore
180 mtn --db=$REPOSITORY --branch=$BRANCH import . -m "initial import"
182 mtn --db=$REPOSITORY --branch=$BRANCH checkout $SRCDIR
183 mv $SRCDIR-old/.ikiwiki $SRCDIR
184 cat << EOF > $SRCDIR/_MTN/monotonerc
185 function get_passphrase (branchname)
192 ## Configure ikiwiki to use revision control.
194 Once your wiki is checked in to the revision control system,
195 you should configure ikiwiki to use revision control. Edit your
196 ikiwiki.setup, and uncomment the lines for the revision control system
197 you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
198 subversion. Uncomment the block for the wrapper for your revision
199 control system, and configure the wrapper path in that block
200 appropriately (for Git, it should be `$REPOSITORY/hooks/post-update`).
202 Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
203 Now you should be able to edit files in $SRCDIR, and use your revision
204 control system to commit them, and the wiki will automatically update.
205 And in the web interface, RecentChanges should work, and files changed
206 by web users will also be committed using revision control.
208 ## Enjoy your new wiki!
210 Add yourself to [[IkiWikiUsers]]. And check out
211 the [[tips]] to find out how to get more out of ikiwiki.