From c4e0e8c36c89fa26e76bb21dbdb8263ee88d5143 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 2 Apr 2006 22:24:08 +0000 Subject: [PATCH] - add to cgi output, this is especially useful for output containing wikilinks since the urls should work now in more situations - drop --limit from svn log run, since a) it needs a fairly new svn and b) in some cases, it would limit it to too few entries to display the requested number of changes - Use driver:DB_File and not driver:db_file for better compatability with old versions of CGI::Session. - Note that HTML::Template 3.02.02 is needed. --- IkiWiki/CGI.pm | 4 +++- IkiWiki/Rcs/SVN.pm | 2 +- doc/bugs.mdwn | 7 ++++--- doc/setup.mdwn | 4 ++-- ikiwiki | 1 + templates/editpage.tmpl | 3 +++ templates/misc.tmpl | 3 +++ templates/recentchanges.tmpl | 3 +++ 8 files changed, 20 insertions(+), 7 deletions(-) diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 9e85e1f44..b07e7fd64 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -39,6 +39,7 @@ sub cgi_recentchanges ($) { #{{{ wikiname => $config{wikiname}, changelog => [rcs_recentchanges(100)], styleurl => styleurl(), + baseurl => "$config{url}/", ); print $q->header, $template->output; } #}}} @@ -329,6 +330,7 @@ sub cgi_editpage ($$) { #{{{ $form->tmpl_param("helponformattinglink", htmllink("", "HelpOnFormatting", 1)); $form->tmpl_param("styleurl", styleurl()); + $form->tmpl_param("baseurl", "$config{url}/"); if (! $form->submitted) { $form->field(name => "rcsinfo", value => rcs_prepedit($file), force => 1); @@ -509,7 +511,7 @@ sub cgi () { #{{{ CGI::Session->name("ikiwiki_session_$config{wikiname}"); my $oldmask=umask(077); - my $session = CGI::Session->new("driver:db_file", $q, + my $session = CGI::Session->new("driver:DB_File", $q, { FileName => "$config{wikistatedir}/sessions.db" }); umask($oldmask); diff --git a/IkiWiki/Rcs/SVN.pm b/IkiWiki/Rcs/SVN.pm index 02fc3ed31..c6f8f2ab1 100644 --- a/IkiWiki/Rcs/SVN.pm +++ b/IkiWiki/Rcs/SVN.pm @@ -111,7 +111,7 @@ sub rcs_recentchanges ($) { #{{{ my $div=qr/^--------------------+$/; my $state='start'; my ($rev, $user, $when, @pages, @message); - foreach (`LANG=C svn log --limit $num -v '$svn_url'`) { + foreach (`LANG=C svn log -v '$svn_url'`) { chomp; if ($state eq 'start' && /$div/) { $state='header'; diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index 06fa54bcd..5ef78b25a 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -21,13 +21,12 @@ page that someone wrote in a web browser annoying (`gqip` is vim user's friend here). Is there any way to improve this? * The diff links in RecentChanges go to a viewcvs backtrace if the rev in question is when the page was added. Is this a viewcvs bug, or a behavior ikiwiki needs to work around? + - As a special case, there should certianly be no history link for + pages generated from the underlaydir as it can never work for them. * If a page stops inlining anthing, its rss feed file will linger around and not be deleted. * Currently only one blog is supported per page. Attempts to add more will make it only update one of the blogs on the page. -* If I edit blog/entry/blog_moved, add a link to code/ikiwiki, and hit - preview, it doesn't get the link right because it makes it relative to - where the page will be saved to, not to where the cgi script is. * RSS output contains relative links. Ie. http://kitenet.net/~joey/blog/index.rss contains a link to http://kitenet.net/~joey/blog/../blog.html * If a file in the srcdir is removed, exposing a file in the underlaydir, ikiwiki will not notice the change and rebuild it until the file in the @@ -37,3 +36,5 @@ * Markdown will try to expand stuff inside postprocessordirectives. For example, if there are two *'s, it will turn them to html em's, which breaks things unexpectedly and requires escaping. +* ikiwiki will generate html formatted error messages to the command + line if --cgi is set, even if it's not yet running as a cgi diff --git a/doc/setup.mdwn b/doc/setup.mdwn index b49c2918e..e80ba24ac 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -7,8 +7,8 @@ optional support for commits from the web. apt-get install ikiwiki # soon Ikiwiki requires [[MarkDown]] be installed, and also uses the following - perl modules: `CGI::Session` `CGI::FormBuilder` `HTML::Template` - `Mail::SendMail` `Time::Duration` + perl modules: `CGI::Session` `CGI::FormBuilder` (version 3.02.02 or + newer) `HTML::Template` `Mail::SendMail` `Time::Duration` 2. Create the subversion repository for your wiki. diff --git a/ikiwiki b/ikiwiki index 8eebcdf77..f7ccaf743 100755 --- a/ikiwiki +++ b/ikiwiki @@ -428,6 +428,7 @@ sub misctemplate ($$) { #{{{ wikiname => $config{wikiname}, pagebody => $pagebody, styleurl => styleurl(), + baseurl => "$config{url}/", ); return $template->output; }#}}} diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl index 1733483d3..4724cd65f 100644 --- a/templates/editpage.tmpl +++ b/templates/editpage.tmpl @@ -2,6 +2,9 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + + + <TMPL_VAR FORM-TITLE> diff --git a/templates/misc.tmpl b/templates/misc.tmpl index 442db8c21..1f724d3cd 100644 --- a/templates/misc.tmpl +++ b/templates/misc.tmpl @@ -2,6 +2,9 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + + + <TMPL_VAR TITLE> diff --git a/templates/recentchanges.tmpl b/templates/recentchanges.tmpl index 9836e1f2a..f9e7541da 100644 --- a/templates/recentchanges.tmpl +++ b/templates/recentchanges.tmpl @@ -2,6 +2,9 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + + + <TMPL_VAR TITLE>