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