1 This tutorial will walk you through setting up a wiki with ikiwiki,
2 doing everything by hand. [[Setup]] has an easier method, but with less
7 ## Decide where your wiki's files will go.
9 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
10 and outputs the files to a destination directory. If you keep your wiki in
11 a version control system, the source directory will contain a working copy
12 checked out from the version control system.
14 For the purposes of this tutorial, we'll set shell variables
15 for these locations, and use those variables in the commands that follow.
18 DESTDIR=~/public_html/wiki/
20 Note that ikiwiki owns the working copy directory; do not perform your own
21 edits in ikiwiki's working copy.
23 ## Create the beginnings of your wiki.
25 This will create a simple main page for the wiki.
31 In the editor, you could start by entering a simple page like
32 [[!toggle id=page text="this one"]].
33 [[!toggleable id=page text="""
34 Welcome to your new wiki.
36 All wikis are supposed to have a \[[SandBox]],
41 This wiki is powered by [ikiwiki](http://ikiwiki.info).
44 See [[ikiwiki/formatting]] for details about the markup language.
46 Note that several [[standard_wiki_pages|basewiki]] will be added to your
47 wiki, from files in `/usr/share/ikiwiki/basewiki/`, so your wiki will
48 automatically get a [[SandBox]], and some other useful pages.
50 ## Build your wiki for the first time.
52 ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
54 Replace the url with the real url to your wiki. You should now
55 be able to visit the url and see your wiki.
57 ## Add content to your wiki.
59 Continue editing or adding pages and rebuilding the wiki.
61 To quickly get started on a common task like blogging with ikiwiki, you
62 can copy in files from the [[examples]]. The examples are located in
63 `doc/examples/` in the ikiwiki source package.
65 You can experiment with other ikiwiki parameters such as `--wikiname`
66 and `--rebuild` too. Get comfortable with its command line (see
71 By now you should be getting tired of typing in all the command line
72 options each time you change something in your wiki's setup. Time to
73 introduce setup files.
75 To generate a setup file, use `ikiwiki --dumpsetup`. You can pass
76 all the options have you been including at the command line, and they
77 will be stored in the setup file.
79 ikiwiki $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/ --dumpsetup ikiwiki.setup
81 Note that this file should *not* be put in your wiki's directory with
82 the rest of the files. A good place to put it is in a ~/.ikiwiki/
85 Most of the options, like `wikiname` in the setup file are the same as
86 ikiwiki's command line options (documented in [[usage]]). `srcdir` and
87 `destdir` are the two directories you specify when running ikiwiki by
88 hand. Make sure that these are pointing to the right directories, and
89 read through and configure the rest of the file to your liking.
91 When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
92 will set everything up.
94 ## Turn on additional features.
96 [[!template id="note" text="""
97 CGI configuration is heavily dependent on webserver. Figure out (or
98 configure) the location and/or filename extension your webserver
99 needs to execute a CGI, then set `cgi_wrapper` to a suitable path.
102 Now you have a basic wiki with a setup file. Time to experiment
103 with ikiwiki's many features.
105 Let's first enable a key wiki feature and set up [[CGI]] to allow
106 editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
107 settings for the `cgi_wrapper`, make sure the filename for the cgi wrapper
108 is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
110 There are lots of other configuration options in ikiwiki.setup that you
111 can uncomment, configure, and enable by re-running
112 `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
115 ## Put your wiki in revision control.
117 At this point you might want to check your wiki in to a revision control
118 system so you can keep track of changes and revert edits. Depending
119 on the revision control system you choose, the way this is done varies.
121 Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and
122 should be preserved, but not checked into revision control.
124 The [[ikiwiki-makerepo]] command automates setting up a wiki in
127 [[!toggle id=subversion text="Subversion"]]
128 [[!toggleable id=subversion text="""
129 REPOSITORY=~/wikirepo
130 ikiwiki-makerepo svn $SRCDIR $REPOSITORY
133 [[!toggle id=cvs text="CVS"]]
134 [[!toggleable id=cvs text="""
135 REPOSITORY=~/wikirepo
136 ikiwiki-makerepo cvs $SRCDIR $REPOSITORY
139 [[!toggle id=git text="Git"]]
140 [[!toggleable id=git text="""
141 REPOSITORY=~/wiki.git
142 ikiwiki-makerepo git $SRCDIR $REPOSITORY
144 Please see [[rcs/git]] for detailed documentation about how
145 ikiwiki uses git repositories, and some important caveats
146 about using the git repositories.
149 [[!toggle id=mercurial text="Mercurial"]]
150 [[!toggleable id=mercurial text="""
152 ikiwiki-makerepo mercurial $SRCDIR
155 [[!toggle id=bazaar text="Bazaar"]]
156 [[!toggleable id=bazaar text="""
158 ikiwiki-makerepo bzr $SRCDIR
161 [[!toggle id=tla text="TLA"]]
162 [[!toggleable id=tla text="""
163 REPOSITORY=~/wikirepo
164 tla make-archive me@localhost--wiki $REPOSITORY
165 tla my-id "<me@localhost>"
167 tla archive-setup me@localhost--wiki/wiki--0
168 tla init-tree me@localhost--wiki/wiki--0
169 # Edit {arch}/=tagging-method and change the precious
170 # line to add the .ikiwiki directory to the regexp.
175 [[!toggle id=monotone text="Monotone"]]
176 [[!toggleable id=monotone text="""
177 # This assumes that you have already used "mtn genkey you@hostname".
178 REPOSITORY=~/wiki.monotone
179 ikiwiki-makerepo monotone $SRCDIR $REPOSITORY
182 ## Configure ikiwiki to use revision control.
184 Once your wiki is checked in to the revision control system, you should
185 configure ikiwiki to use revision control. Edit your ikiwiki.setup, set
186 `rcs` to the revision control system you chose to use. Be careful,
187 you may need to use the 'fullname'. For example, 'hg' doesn't work, you
188 should use mercurial. Be sure to set `svnrepo` to the directory for your
189 repository, if using subversion. Uncomment the configuration for the wrapper
190 for your revision control system, and configure the wrapper path appropriately
191 (for Git, it should be the path to `hooks/post-update` inside the bare git repository).
193 Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
194 Now you should be able to edit files in $SRCDIR, and use your revision
195 control system to commit them, and the wiki will automatically update.
196 And in the web interface, RecentChanges should work, and files changed
197 by web users will also be committed using revision control.
199 ## Enjoy your new wiki!
201 Add yourself to [[IkiWikiUsers]]. And check out
202 the [[tips]] to find out how to get more out of ikiwiki.