PLEASE Please note: There are some hard-coded values that I used to get myself up and running here (such as the location of the content wiki repository). Until I've removed this note, double-check the code for hard-coded stuff if you can't get yours working.
Please note: I've heavily modified potomak's git-wiki fork of sr's original code. As such, I'm changing the README to keep the current state of the documentation of THIS fork up-to-date so that anyone that forks from here will have good info on what to expect, how to install, etc.
December 6th, 2011
git-wiki is a wiki that relies on git to keep pages' history and Sinatra to serve them.
It can be run using pow as I do, or by any server that can host Rack-based applications.
Fork this repository or clone it somewhere on your disk. For the purposes of this explanation, we'll assume you clone it into
$ mkdir -p ~/code/apps $ cd ~/code/apps $ git clone firstname.lastname@example.org:whazzmaster/git-wiki.git
Gemfile should contain everything you need to get started (though you may need to add additional gems such as
unicorn if you wish to serve using them.) Run
bundle to get setup.
$ cd ~/code/apps/git-wiki $ bundle install
The following gems are required to run git-wiki:
Setup the content repository
This confused me at first so I way to explain it explicitly: the code that runs git-wiki and the wiki content itself are stored in two completely separate repositories
The code you clone into
~/code/apps/git-wiki runs the wiki web interface, but the content is stored in a separate git repository that you will create now. Again, this can be located anywhere but we'll assume you put it in
$ mkdir ~/.wiki $ cd ~/.wiki $ git init
You should now be setup with an empty git repository ripe for the wiki-ing.
Serving the wiki
Now you should just need to startup whatever server you're going to use to serve this thing. So, for instance, if you're using pow, here's what you would do:
$ cd ~/.pow $ ln -s /Users/myuser/code/apps/git-wiki
Point your browser at
http://git-wiki.dev and you should now see the empty home page of your new wiki.
Listed below are non-compatible changes I've made to how git-wiki works. You could run into incompatibility issues if you try to load a wiki repo created in another version of git-wiki using this code.
There have been major changes in this fork to how git-wiki recognizes and processes WikiWords (i.e., the strings that denote links to other wiki pages.)
The existing functionality of the wiki_word method wasn't robust enough for what I wanted. It lacked two things:
- The ability to define wiki words that weren't camel cased (for example: "Golf")
- The ability to link to a wiki page while displaying custom text in the link.
The new wiki_word function works as follows:
- All links to wiki pages are enclosed in double-square brackets, example: [[MyWikiPage]]
- Names of wiki pages must begin with capital letter, and can only contain alpha-characters.
- The first non-space containing word is the name of the page; all following words within the double-brackets are the text that will be used in the link body.
Wiki Words are translated to markdown-style links. Example:
[link text](link) If no custom link text is provided, the link body will be the wiki word itself. Some examples are provided below:
[[MyWikiEntry my wiki entry]] becomes [my wiki entry](/MyWikiEntry) [[Golf]] becomes [Golf](/Golf)
- How to use vim to edit <textarea> in lynx
- WiGit think git-wiki except implemented in PHP
- ikiwiki is a wiki compiler supporting git
[...] the first wiki engine I'd consider worth using for my own projects.
Oh, it looks like Git Wiki may be the starting point for what I need...
What makes git-wiki so cool is because it is backed by a git store, you can clone your wiki just like you could any other git repository. I’ve always wanted a wiki that I could a.) pull offline when I didn’t have access to the Internets and b.) edit (perhaps in bulk) in my favorite text editor. git-wiki allows both.
Numerous people have written diff and merge systems for wikis; TWiki even uses RCS. If they used git instead, the repository would be tiny, and you could make a personal copy of the entire wiki to take on the plane with you, then sync your changes back when you're done.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2008 Simon Rozet <email@example.com> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.