*warning* any wrappers built with a previous version of ikiwiki need to be

rebuilt

This changes ikiwiki's syntax to require only 2 parameters (source and
dest) and not three. The templatedir parameter is now an optional
--templatedir.
master
joey 2006-03-23 02:53:03 +00:00
parent 483f61d228
commit 0b1828f694
5 changed files with 23 additions and 19 deletions

View File

@ -12,8 +12,8 @@ install:: extra_install
pure_install:: extra_install
extra_build:
./ikiwiki doc templates html --wikiname="ikiwiki" --verbose \
--nosvn --exclude=/discussion
./ikiwiki doc html --templatedir=templates --wikiname="ikiwiki" \
--verbose --nosvn --exclude=/discussion
./mdwn2man doc/usage.mdwn > ikiwiki.man
extra_clean:

View File

@ -12,12 +12,12 @@ use IkiWiki::Setup::Standard {
# Be sure to customise these..
srcdir => "/path/to/source",
destdir => "/var/www/wiki",
templatedir => "/usr/share/ikiwiki/templates",
url => "http://myhost/wiki",
cgiurl => "http://myhost/ikiwiki.cgi",
#historyurl => "http://svn.myhost/trunk/[[file]]",
#diffurl => "http://svn.someurl/trunk/[[file]]?root=wiki&r1=[[r1]]&r2=[[r2]]",
#templatedir => "/usr/share/ikiwiki/templates",
# Whether to integrate with svn.
svn => 1,

View File

@ -29,11 +29,10 @@ optional support for commits from the web.
5. Build your wiki for the first time.
ikiwiki --verbose ~/wikiwc/ \
/usr/share/ikiwiki/templates ~/public_html/wiki/ \
ikiwiki --verbose ~/wikiwc/ ~/public_html/wiki/ \
--url=http://host/~you/wiki/
Replace the url with the right url to your wiki. You should now
Replace the url with the real url to your wiki. You should now
be able to visit the url and see your page that you created earlier.
6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
@ -50,8 +49,8 @@ optional support for commits from the web.
`doc/ikiwiki.setup` in the ikiwiki sources), and edit it.
Most of the options, like `wikiname` in the setup file are the same as
ikiwiki's command line options (documented in [[usage]]. `srcdir`,
`templatedir` and `destdir` are the three directories you specify when
ikiwiki's command line options (documented in [[usage]]. `srcdir`
and `destdir` are the two directories you specify when
running ikiwiki by hand. `svnrepo` is the path to your subversion
repository. Make sure that all of these are pointing to the right
directories, and read through and configure the rest of the file to your

View File

@ -4,15 +4,14 @@ ikiwiki - a wiki compiler
# SYNOPSIS
ikiwiki [options] source templates destination
ikiwiki [options] source destination
ikiwiki --setup configfile
# DESCRIPTION
`ikiwiki` is a wiki compiler. It builds static html pages for a wiki, from
`source` in the [[MarkDown]] language, using the specified html `templates`
and writes it out to `destination`.
`source` in the [[MarkDown]] language, and writes it out to `destination`.
# OPTIONS
@ -31,6 +30,11 @@ flags such as --verbose can be negated with --no-verbose.
Force a rebuild of all pages.
* --templatedir
Specify the directory that the page [[templates]] are stored in.
Default is `/usr/share/ikiwiki/templates`.
* --wrapper [file]
Generate a [[wrapper]] binary that is hardcoded to do action specified by

13
ikiwiki
View File

@ -33,7 +33,7 @@ our %config=( #{{{
wrappermode => undef,
srcdir => undef,
destdir => undef,
templatedir => undef,
templatedir => "/usr/share/ikiwiki/templates",
setup => undef,
adminuser => undef,
); #}}}
@ -56,12 +56,12 @@ GetOptions( #{{{
$config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/;
},
"adminuser=s@" => sub { push @{$config{adminuser}}, $_[1] },
"templatedir=s" => sub { $config{templatedir}=possibly_foolish_untaint($_[1]) },
) || usage();
if (! $config{setup}) {
usage() unless @ARGV == 3;
usage() unless @ARGV == 2;
$config{srcdir} = possibly_foolish_untaint(shift);
$config{templatedir} = possibly_foolish_untaint(shift);
$config{destdir} = possibly_foolish_untaint(shift);
if ($config{cgi} && ! length $config{url}) {
error("Must specify url to wiki with --url when using --cgi");
@ -70,7 +70,7 @@ if (! $config{setup}) {
#}}}
sub usage { #{{{
die "usage: ikiwiki [options] source templates dest\n";
die "usage: ikiwiki [options] source dest\n";
} #}}}
sub error { #{{{
@ -772,8 +772,9 @@ sub gen_wrapper (@) { #{{{
error("cannot create a wrapper that uses a setup file");
}
my @params=($config{srcdir}, $config{templatedir}, $config{destdir},
"--wikiname=$config{wikiname}");
my @params=($config{srcdir}, $config{destdir},
"--wikiname=$config{wikiname}",
"--templatedir=$config{templatedir}");
push @params, "--verbose" if $config{verbose};
push @params, "--rebuild" if $config{rebuild};
push @params, "--nosvn" if !$config{svn};