diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-13 00:52:57 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-13 00:52:57 +0000 |
commit | 2d4bf757fb63d7d9e7ccfbbbd0e1913fa5dacae5 (patch) | |
tree | e8daf226fdc5d507eb3517bda44c163949a223ea | |
parent | f4a6a03de6b64252006d7b56314450f6d8b4fa20 (diff) | |
download | ikiwiki-2d4bf757fb63d7d9e7ccfbbbd0e1913fa5dacae5.tar ikiwiki-2d4bf757fb63d7d9e7ccfbbbd0e1913fa5dacae5.tar.gz |
- Add Discussion links to the button bar, these will automatically create
/Discussion subpages.
- Fix linking to DNE pages in some edge cases.
- Fix --rebuild (oops)
- Fix propigation of "from" field trru the login process when creating a
new page.a
- Ideas for change notification.
-rw-r--r-- | doc/bugs.mdwn | 24 | ||||
-rw-r--r-- | doc/features.mdwn | 6 | ||||
-rw-r--r-- | doc/todo.mdwn | 19 | ||||
-rwxr-xr-x | ikiwiki | 34 | ||||
-rw-r--r-- | templates/page.tmpl | 2 |
5 files changed, 69 insertions, 16 deletions
diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index 34342b59f..72719ba29 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -4,16 +4,32 @@ to point to it, but will forget to update the linkbacks in Foo/Baz. And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link back to Foo/Baz. + + Basically this makes creating new pages painful, top of TODO list.. + * Foo/Bar/Baz shows up as Bar/Baz in the linkbacks on page Foo/Bar. Should show as just Baz there. * If I try to do a web commit, to a svn+ssh repo, it fails with "Host key verification failed." I think that the setuid isn't fully taking; it should be running as me, - but commit log shows www-data. So maybe it has the wrong username? + but commit log shows www-data. So maybe it has the wrong username? Or + EUID/Real UID screwage. * Can't put the source in a directory named .source; the page finder skips that due to too broad exclusion of any dotfile in a path. -* RecentChanges is a regular page, perhaps it should be automatically replaced with a link to the [[CGI]]? +* RecentChanges is a regular page, perhaps it should be automatically + replaced with a link to the [[CGI]]? * [[ikiwiki]] should go to the same place as [[index]] (on this wiki). * There's no way to escape a [[WikiLink]] when discussing one on a wiki. -* Wikilinks are even expanded in the middle of [[MarkDown]] code blocks, and probably shouldn't be (nor in blockquotes?) -* RecentChanges is supposed to linkify WikiNames and it does, but only if the user's page exists. It doesn't add a ?link to a noneistant page to aid creating it.
\ No newline at end of file +* Wikilinks are even expanded in the middle of [[MarkDown]] code blocks, + and probably shouldn't be (nor in blockquotes?) + + Hmm, the best way to fix this would be to add WikiLink support into + markdown, but that will probably be a bear. I guess the question is how + common "[[ ]]" is, and maybe we should just provide a way to escape a + wikilink.. + +Fixed bugs: + +* RecentChanges is supposed to linkify WikiNames and it does, but only if + the user's page exists. It doesn't add a ?link to a noneistant page to + aid creating it. (Fixed. -- [[Joey]]) diff --git a/doc/features.mdwn b/doc/features.mdwn index 8a05a1679..e56a075d7 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -58,6 +58,12 @@ Currently implemented: Can optionally be configured to allow only registered users to post pages; online user registration form, etc. +* Discussion pages + + Thanks to subpages, every page can easily and automatically have a + /Discussion subpage. By default, these links are included in the + [[templates]] for each page. + ---- It also has lots of [[TODO]] items and [[Bugs]]. This wiki is not ready for production! diff --git a/doc/todo.mdwn b/doc/todo.mdwn index 2244edc4f..4d82be982 100644 --- a/doc/todo.mdwn +++ b/doc/todo.mdwn @@ -8,7 +8,16 @@ ## recentchanges -Should support RSS for notification of new and changed pages. +* Should support RSS for notification of new and changed pages. + + This can be a static rss file that is generated when the moo +is built. (As long as all changes to all pages is ok.) + +* Should support mail notification of new and changed pages. + + Hmm, should be easy to implement this.. it runs as a svn post-cookit hook + already, so just look at the userdb, svnlook at what's changed, and send + mails to people who have subscribed. ## docs @@ -44,4 +53,12 @@ case. Make the html valid. Add css. +## sigs + +Need a way to sign name in page that's easier to type than "-- [[ Joey ]]" +and that includes the date. + +What syntax do other wikis use for this? I'm considering "[[ -- ]]" (with +spaces removed) as it has a nice nmemonic. + ## [[Bugs]] @@ -27,6 +27,7 @@ my $cgiurl=""; my $historyurl=""; my $svn=1; my $anonok=0; +my $rebuild=0; sub usage { #{{{ die "usage: ikiwiki [options] source templates dest\n"; @@ -177,11 +178,12 @@ sub isinlinableimage ($) { #{{{ sub htmllink { #{{{ my $page=shift; my $link=shift; - my $noimagelink=shift; + my $noimageinline=shift; # don't turn links into inline html images + my $createsubpage=shift; # force creation of a subpage if page DNE my $bestlink=bestlink($page, $link); - return $link if $page eq $bestlink; + return $link if length $bestlink && $page eq $bestlink; # TODO BUG: %renderedfiles may not have it, if the linked to page # was also added and isn't yet rendered! Note that this bug is @@ -191,12 +193,17 @@ sub htmllink { #{{{ $bestlink=htmlpage($bestlink); } if (! grep { $_ eq $bestlink } values %renderedfiles) { - return "<a href=\"$cgiurl?do=create&page=$link&from=$page\">?</a>$link" + if (! $createsubpage) { + return "<a href=\"$cgiurl?do=create&page=$link&from=$page\">?</a>$link" + } + else { + return "<a href=\"$cgiurl?do=create&page=$page/$link\">?</a>$link" + } } $bestlink=File::Spec->abs2rel($bestlink, dirname($page)); - if (! $noimagelink && isinlinableimage($bestlink)) { + if (! $noimageinline && isinlinableimage($bestlink)) { return "<img src=\"$bestlink\">"; } return "<a href=\"$bestlink\">$link</a>"; @@ -271,7 +278,7 @@ sub parentlinks ($) { #{{{ sub indexlink () { #{{{ return "<a href=\"$url\">$wikiname</a>"; } #}}} - + sub finalize ($$) { #{{{ my $content=shift; my $page=shift; @@ -301,6 +308,7 @@ sub finalize ($$) { #{{{ parentlinks => [parentlinks($page)], content => $content, backlinks => [backlinks($page)], + discussionlink => htmllink($page, "Discussion", 1, 1), ); return $template->output; @@ -312,8 +320,11 @@ sub check_overwrite ($$) { #{{{ my $dest=shift; my $src=shift; - if (! exists $renderedfiles{$src} && -e $dest) { - error("$dest exists and was not rendered from $src before, not overwriting"); + if (! exists $renderedfiles{$src} && -e $dest && ! $rebuild) { + error("$dest exists and was rendered from ". + join(" ",(grep { $renderedfiles{$_} eq $dest } keys + %renderedfiles)). + ", not from $src before not overwriting"); } } #}}} @@ -757,7 +768,7 @@ sub cgi_signin ($$) { #{{{ eval q{use CGI::FormBuilder}; my $form = CGI::FormBuilder->new( title => "$wikiname signin", - fields => [qw(do page name password confirm_password email)], + fields => [qw(do page from name password confirm_password email)], header => 1, method => 'POST', validate => { @@ -777,6 +788,7 @@ sub cgi_signin ($$) { #{{{ $form->field(name => "name", required => 0); $form->field(name => "do", type => "hidden"); $form->field(name => "page", type => "hidden"); + $form->field(name => "from", type => "hidden"); $form->field(name => "password", type => "password", required => 0); $form->field(name => "confirm_password", type => "password", required => 0); $form->field(name => "email", required => 0); @@ -850,7 +862,8 @@ sub cgi_signin ($$) { #{{{ $form->field("do") ne 'signin') { print $q->redirect( "$cgiurl?do=".$form->field("do"). - "&page=".$form->field("page")); + "&page=".$form->field("page"). + "&from=".$form->field("from"));; } else { print $q->redirect($url); @@ -1035,7 +1048,7 @@ sub cgi_editpage ($$) { #{{{ # The trailing question mark tries to avoid broken # caches and get the most recent version of the page. - print $q->redirect("$url/".htmlpage($page)."?"); + print $q->redirect("$url/".htmlpage($page)."?updated"); } } #}}} @@ -1085,7 +1098,6 @@ sub cgi () { #{{{ } #}}} # main {{{ -my $rebuild=0; my $wrapper=0; if (grep /^-/, @ARGV) { eval {use Getopt::Long}; diff --git a/templates/page.tmpl b/templates/page.tmpl index 619b437b9..4531157ba 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -21,6 +21,8 @@ <a href="<TMPL_VAR HISTORYURL>">History</a> </TMPL_IF> +<TMPL_VAR DISCUSSIONLINK><br> + <hr> <TMPL_VAR CONTENT> <hr> |