]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
web commit by http://jh.mcaleely.com/: a test
[ikiwiki.git] / doc / setup.mdwn
1 This tutorial will walk you through setting up a wiki with ikiwiki.
2
3 [[toc ]]
4
5 ## [[Download]] and [[install]] ikiwiki.
6
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.
9
10 ## Decide where your wiki's files will go.
11
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.
16
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.
19
20         SRCDIR=~/wikiwc
21         DESTDIR=~/public_html/wiki/
22
23 Note that ikiwiki owns the working copy directory; do not perform your own
24 edits in ikiwiki's working copy.
25
26 ## Create the beginnings of your wiki.
27
28 This will create a simple main page for the wiki.
29
30         mkdir $SRCDIR
31         cd $SRCDIR
32         $EDITOR index.mdwn
33
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.
38
39         All wikis are supposed to have a \[[SandBox]],
40         so this one does too.
41
42         ----
43
44         This wiki is powered by [ikiwiki](http://ikiwiki.info).
45 """]]
46    
47 See [[ikiwiki/formatting]] for details about the markup language.
48
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.
52
53 ## Build your wiki for the first time.
54
55         ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
56
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.
59
60 ## Add content to your wiki.
61
62 Continue editing or adding pages and rebuilding the wiki.
63    
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.
67
68 You can experiment with other ikiwiki parameters such as `--wikiname`
69 and `--rebuild` too. Get comfortable with its command line (see
70 [[usage]]).
71
72 ## Add a setup file.
73
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.
77    
78 A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
79 `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. Note that this
80 file should *not* be put in your wiki's directory with the rest of the
81 files. A good place to put it is in a ~/.ikiwiki/ subdirectory.
82    
83 Most of the options, like `wikiname` in the setup file are the same as
84 ikiwiki's command line options (documented in [[usage]]. `srcdir` and
85 `destdir` are the two directories you specify when running ikiwiki by
86 hand. Make sure that these are pointing to the right directories, and
87 read through and configure the rest of the file to your liking.
88
89 When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
90 will set everything up.
91
92 ## Turn on additional features.
93
94 Now you have a basic wiki with a configuration file. Time to experiment
95 with ikiwiki's many features. 
96    
97 Let's first enable a key wiki feature and set up [[CGI]] to allow
98 editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
99 block for the cgi wrapper, make sure the filename for the cgi wrapper
100 is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
101
102 There are lots of other configuration options in ikiwiki.setup that you
103 can uncomment, configure, and enable by re-running
104 `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
105 [[plugins]]..
106
107 ## Put your wiki in revision control.
108
109 At this point you might want to check your wiki in to a revision control
110 system so you can keep track of changes and revert edits. Depending
111 on the revision control system you choose, the way this is done varies.
112
113 Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and
114 should be preserved, but not checked into revision control.
115
116 The new [[ikiwiki-makerepo]] command automates setting up a wiki in
117 revision control.
118
119 [[toggle id=subversion text="Subversion"]]
120 [[toggleable id=subversion text="""
121         REPOSITORY=~/wikirepo
122         ikiwiki-makerepo svn $SRCDIR $REPOSITORY
123 """]]
124
125 [[toggle id=git text="Git"]]
126 [[toggleable id=git text="""
127         REPOSITORY=~/wiki.git
128         ikiwiki-makerepo git $SRCDIR $REPOSITORY
129
130 Please see [[rcs/git]] for detailed documentation about how
131 ikiwiki uses git repositories, and some important caveats
132 about using the git repositories.
133 """]]
134
135 [[toggle id=mercurial text="Mercurial"]]
136 [[toggleable id=mercurial text="""
137         REPOSITORY=$SRCDIR
138         ikiwiki-makerepo mercurial $SRCDIR
139 """]]
140
141 [[toggle id=bazaar text="Bazaar"]]
142 [[toggleable id=bazaar text="""
143         REPOSITORY=$SRCDIR
144         ikiwiki-makerepo bzr $SRCDIR
145 """]]
146
147 [[toggle id=tla text="TLA"]]
148 [[toggleable id=tla text="""
149         REPOSITORY=~/wikirepo
150         tla make-archive me@localhost--wiki $REPOSITORY
151         tla my-id "<me@localhost>"
152         cd $SRCDIR
153         tla archive-setup me@localhost--wiki/wiki--0
154         tla init-tree me@localhost--wiki/wiki--0
155         # Edit {arch}/=tagging-method and change the precious
156         # line to add the .ikiwiki directory to the regexp.
157         tla add *
158         tla import
159 """]]
160
161 [[toggle id=monotone text="Monotone"]]
162 [[toggleable id=monotone text="""
163         # These instructions are standard instructions to import a directory into monotone
164         # and set it up so that you don't need any passwords to use it
165         REPOSITORY=~/.ikiwiki/mtn.db
166         BRANCH=com.company.wikiname
167         # remember the password you use in the next step and
168         # substitute it for 'wikiKeyPass' in the get_passphrase() hook below
169         # note the you should never generate two monotone keys with the same name
170         mtn genkey web@machine.company.com
171         mtn db init --db=$REPOSITORY
172         mv $SRCDIR $SRCDIR-old
173         cd $SRCDIR-old
174         echo ".ikiwiki" > $SRCDIR-old/.mtn-ignore
175         mtn --db=$REPOSITORY --branch=$BRANCH import . -m "initial import"
176         cd ..
177         mtn --db=$REPOSITORY --branch=$BRANCH checkout $SRCDIR
178         mv $SRCDIR-old/.ikiwiki $SRCDIR
179         cat << EOF > $SRCDIR/_MTN/monotonerc
180         function get_passphrase (branchname)
181             return "wikiKeyPass"
182         end
183         EOF
184         rm -r $SRCDIR-old
185 """]]
186
187 ## Configure ikiwiki to use revision control.
188
189 Once your wiki is checked in to the revision control system,
190 you should configure ikiwiki to use revision control. Edit your
191 ikiwiki.setup, and uncomment the lines for the revision control system
192 you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
193 subversion. Uncomment the block for the wrapper for your revision
194 control system, and configure the wrapper path in that block
195 appropriately (for Git, it should be `$REPOSITORY/hooks/post-update`).
196
197 Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
198 Now you should be able to edit files in $SRCDIR, and use your revision
199 control system to commit them, and the wiki will automatically update.
200 And in the web interface, RecentChanges should work, and files changed
201 by web users will also be committed using revision control.
202
203 ## Enjoy your new wiki!
204
205 Add yourself to [[IkiWikiUsers]]. And check out
206 the [[tips]] to find out how to get more out of ikiwiki.