Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

lithammer/go-wiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Wiki

A simple HTTP server rendering Markdown styled documents on the fly and optionally shows its git history including diffs.

NOTE This is toy project to help me learn Go, so don't run this on anything publically available.

Screenshot1

Installation

$ go get github.com/renstrom/go-wiki
$ $GOPATH/bin/go-wiki <path to wiki directory>

Customize

It's only possible to customize the CSS. Put all your customizations in a file of your choosing and point to it using the --custom-css flag.

$ go-wiki ~/www/wiki --custom-css=<path to custom css>

Usage

Create git repository containing your Markdown formatted wiki pages.

On the server

Create an empty repository.

$ mkdir -p ~/www/wiki && cd $_
$ git init
$ git config core.worktree ~/www/wiki
$ git config receive.denycurrentbranch ignore

Setup a post-receive hook.

$ cat > .git/hooks/post-receive <<EOF
#!/bin/sh
git checkout --force
EOF
$ chmod +x .git/hooks/post-receive

Start the server.

$ go-wiki ~/www/wiki

On your local machine

Replace <user> and <host> with credentials for your specific machine.

$ git init
$ git remote add origin \
    ssh://<user>@<host>/home/<user>/www/wiki

Now create some Markdown file and push.

$ git add index.md
$ git commit -m 'Add index page'
$ git push origin master

License

MIT

About

A simple HTTP server rendering Markdown styled documents

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published