]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
plans for 2.0
[ikiwiki.git] / doc / setup.mdwn
1 This tutorial will walk you through setting up a wiki with ikiwiki.
2
3 1. [[Download]] and [[install]] ikiwiki.
4
5 2. Decide where your wiki's files will go.
6
7    As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
8    and outputs the files to a destination directory.  If you keep your wiki in
9    a version control system, the source directory will contain a working copy
10    checked out from the version control system.
11
12    For the purposes of this tutorial, we'll set shell variables
13    for these locations, and use those variables in the commands that follow.
14
15                         SRCDIR=~/wikiwc
16                         DESTDIR=~/public_html/wiki/
17
18    Note that ikiwiki owns the working copy directory; do not perform your own
19    edits in ikiwiki's working copy.
20
21 3. Create the beginnings of your wiki.
22
23    This will create a simple main page for the wiki.
24
25                         mkdir $SRCDIR
26                         cd $SRCDIR
27                         $EDITOR index.mdwn
28
29    In the editor, you could start by entering a simple page like 
30    [[toggle id=page text="this one"]].
31    
32    [[toggleable id=page text="""
33                         Welcome to your new wiki.
34                         All wikis are supposed to have a [[SandBox]],
35                         so this one does too.
36                         ----
37                         This wiki is powered by [ikiwiki](http://ikiwiki.kitenet.net).
38    """]]
39    
40    See [[HelpOnFormatting]] for details about the markup language.
41
42    Note that several standard wiki pages will be added to your wiki, from
43    files in `/usr/share/ikiwiki/basewiki/`, so your wiki will automatically
44    get a [[SandBox]], and some other useful pages.
45
46 4. Build your wiki for the first time.
47
48                         ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
49
50    Replace the url with the real url to your wiki. You should now
51    be able to visit the url and see your wiki.
52
53 5. Repeat steps 3 and 4 as desired, editing or adding pages and rebuilding
54    the wiki. 
55    
56    To quickly get started on a common task like blogging with ikiwiki, you
57    can copy in files from the [[examples]]. The examples are located in
58    `doc/examples/` in the ikiwiki source package.
59
60    You can play around with other ikiwiki parameters such as `--wikiname`
61    and `--rebuild` too. Get comfortable with its command line (see
62    [[usage]]).
63
64 6. By now you should be getting tired of typing in all the command line
65    options each time you change something in your wiki's setup. Time to
66    introduce setup files.
67    
68    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
69    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it.
70    
71    Most of the options, like `wikiname` in the setup file are the same as
72    ikiwiki's command line options (documented in [[usage]]. `srcdir` and
73    `destdir` are the two directories you specify when running ikiwiki by
74    hand. Make sure that these are pointing to the right directories, and
75    read through and configure the rest of the file to your liking.
76
77    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
78    will set everything up.
79
80 7. Turn on additional features.
81
82    Now you have a basic wiki with a configuration file. Time to experiment
83    with ikiwiki's many features. 
84    
85    Let's first enable a key wiki feature and set up [[CGI]] to allow
86    editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
87    block for the cgi wrapper, make sure the filename for the cgi wrapper
88    is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
89
90    There are lots of other configuration options in ikiwiki.setup that you
91    can uncomment, configure, and enable by re-running
92    `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
93    [[plugins]]..
94
95 8. Put your wiki in revision control.
96
97    At this point you might want to check your wiki in to a revision control
98    system you can get history of past changes and revert edits. Depending
99    on the revision control system you choose, the way this is done varies.
100    
101    There's little that's ikiwiki specific about these instructions; this is
102    just how you put a directory under revision control using the various
103    systems that ikiwiki supports. Note that the .ikiwiki subdirectory is
104    where ikiwiki keeps its state, and should be preserved, but not checked
105    into revision control.
106
107    [[toggle id=subversion text="Subversion"]]
108    [[toggleable id=subversion text="""
109                         REPOSITORY=~/wikirepo
110                         svnadmin create $REPOSITORY
111                         svn mkdir file://$REPOSITORY/trunk -m "create trunk"
112                         cd $SRCDIR
113                         svn co file://$REPOSITORY/trunk .
114                         svn add *
115                         svn commit -m "initial import"
116    """]]
117    
118    [[toggle id=git text="Git"]]
119    [[toggleable id=git text="""
120                         REPOSITORY=~/wikirepo
121                         mkdir $REPOSITORY
122                         cd $REPOSITORY
123                         git init-db
124                         cp -a $SRCDIR/* .
125                         git add .
126                         git commit -m "initial import" -a
127                         mv $SRCDIR/.ikiwiki .
128                         rm -rf $SRCDIR
129                         git clone -l -s $REPOSITORY $SRCDIR
130    """]]
131
132    [[toggle id=tla text="TLA"]]
133    [[toggleable id=tla text="""
134                         REPOSITORY=~/wikirepo
135                         tla make-archive me@localhost--wiki $REPOSITORY
136                         tla my-id "<me@localhost>"
137                         cd $SRCDIR
138                         tla archive-setup me@localhost--wiki/wiki--0
139                         tla init-tree me@localhost--wiki/wiki--0
140                         # Edit {arch}/=tagging-method and change the precious
141                         # line to add the .ikiwiki directory to the regexp.
142                         tla add *
143                         tla import
144    """]]
145
146    [[toggle id=mercurial text="Mercurial"]]
147    [[toggleable id=mercurial text="""
148                         REPOSITORY=$SRCDIR
149                         hg init $REPOSITORY
150                         cd $REPOSITORY
151                         hg add *
152                         hg commit -m "initial import"
153    """]]
154
155 9. Configure ikiwiki to use revision control.
156
157    Once your wiki is checked in to the revision control system,
158    you should configure ikiwiki to use revision control. Edit your
159    ikiwiki.setup, and uncomment the lines for the revision control system
160    you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
161    subversion. Uncomment the block for the wrapper for your revision
162    control system, and configure the wrapper path in that block
163    appropriately. 
164    
165    Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
166    Now you should be able to edit files in $SRCDIR, and use your revision
167    control system to commit them, and the wiki will automatically update.
168    And in the web interface, RecentChanges should work, and files changed
169    by web users will also be committed using revision control.
170
171 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]].