From: joey Date: Fri, 10 Mar 2006 04:28:06 +0000 (+0000) Subject: options X-Git-Tag: 1.0~560 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=198c2d9c45cb974aabf999797bdb7d6ab8636b2c;p=ikiwiki.git options --- diff --git a/Makefile b/Makefile index 3e2948044..6c62576b4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ all: - ./ikiwiki doc html + ./ikiwiki doc html --wikiname="ikiwiki" clean: rm -rf html diff --git a/doc/ikiwiki.mdwn b/doc/ikiwiki.mdwn deleted file mode 100644 index ad5485bb7..000000000 --- a/doc/ikiwiki.mdwn +++ /dev/null @@ -1,7 +0,0 @@ -IkiWiki is the engine driving this wiki, which exists to document ikiWiki. -The [[index]] is where you'll find actual useful info about it. - -Why call it IkiWiki? Well, partly because I'm sure some people will find -this a pretty Iky Wiki, since it's so different from other Wikis. Partly -because "ikiwiki" is a nice palindrome. Partly because its design turns -the usual design for a Wiki inside-out and backwards. diff --git a/doc/index.mdwn b/doc/index.mdwn index 327e685af..00a8badf6 100644 --- a/doc/index.mdwn +++ b/doc/index.mdwn @@ -1,9 +1,14 @@ -[[Ikiwiki]] is a wiki compiler. It converts a directory full of wiki pages +Ikiwiki is a wiki compiler. It converts a directory full of wiki pages into html pages suitable for publishing on a website. Unlike a traditional wiki, ikiwiki does not have its own means of storing page history, its own markup language, or support for editing pages online. -To use [[ikiwiki]] to set up a wiki, you will probably want to use it with a +Why call it IkiWiki? Well, partly because I'm sure some people will find +this a pretty Iky Wiki, since it's so different from other Wikis. Partly +because "ikiwiki" is a nice palindrome. Partly because its design turns +the usual design for a Wiki inside-out and backwards. + +To use ikiwiki to set up a wiki, you will probably want to use it with a revision control system, such as [[Subversion]], for keeping track of past versions of pages. ikiwiki can run as a Subversion post-commit hook, so that each committed change to your wiki is immediatly compiled and @@ -31,6 +36,5 @@ ikiwiki also supports making one page that is a [[SubPage]] of another. would consider it a full-fledged wiki. All wikis are supposed to have a [[SandBox]], so this one does to. -If you'd like to try editing pages on this wiki, do whatever you'd like in -[[ikiwiki]] is developed by JoeyHess. +ikiwiki is developed by [[JoeyHess]]. diff --git a/ikiwiki b/ikiwiki index c2d5e6475..08d1c4f81 100755 --- a/ikiwiki +++ b/ikiwiki @@ -14,11 +14,25 @@ BEGIN { memoize('pagename'); memoize('bestlink'); -my ($srcdir)= shift =~ /(.*)/; # untaint -my ($destdir)= shift =~ /(.*)/; # untaint +sub usage { + die "usage: ikiwiki [options] source dest\n"; +} + my $link=qr/\[\[([^\s]+)\]\]/; -my $verbose=1; +my $verbose=0; +my $rebuild=0; my $wikiname="wiki"; +if (grep /^-/, @ARGV) { + eval {use Getopt::Long}; + GetOptions( + "wikiname=s" => \$wikiname, + "verbose|v" => \$verbose, + "rebuild" => \$rebuild, + ) || usage(); +} +usage() unless @ARGV == 2; +my ($srcdir) = shift =~ /(.*)/; # untaint +my ($destdir) = shift =~ /(.*)/; # untaint my %links; my %oldpagemtime; @@ -331,6 +345,10 @@ sub refresh () { debug("rendering changed file $file"); render($file); } + elsif ($rebuild) { + debug("rebuilding unchanged file $file"); + render($file); + } } # if any files were added or removed, check to see if each page