From fc7283c62320ba72b74031017a1266cdf34a28d2 Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 12 Aug 2006 16:54:47 +0000 Subject: [PATCH 01/16] note about perl version --- doc/install.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/install.mdwn b/doc/install.mdwn index d34de92b1..9164d7185 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -1,5 +1,8 @@ The easiest way to install ikiwiki is using the Debian package. +Ikiwiki is a perl program, and needs a recent version of perl such as +5.8.8. (5.8.0 has been reported not to work). + Ikiwiki requires [[MarkDown]] and the `HTML::Parser` perl module be installed, and also uses the following perl modules if available: `CGI::Session` `CGI::FormBuilder` (version 3.02.02 or newer) -- 2.39.5 From 3fcc926c5f01cfb8c16a83db134eef42b3ac6e7e Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 12 Aug 2006 16:56:04 +0000 Subject: [PATCH 02/16] releasing version 1.17 --- IkiWiki/Plugin/inline.pm | 2 +- debian/changelog | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index c98888452..66cba027a 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -96,7 +96,7 @@ sub preprocess_inline (@) { #{{{ # TODO: if $params{archive} eq "no", the only reason to do this # is to let the meta plugin get page title info; so stop # calling this next line then once the meta plugin can - # store that accross runs. + # store that accross runs (also tags plugin). $template->param(content => get_inline_content($page, $params{page})); $template->param(ctime => displaytime($pagectime{$page})); diff --git a/debian/changelog b/debian/changelog index bd653704b..745678056 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (1.17) UNRELEASED; urgency=low +ikiwiki (1.17) unstable; urgency=low * Disable tidy generator tag. * Move tidy back to sanitize hook, found out how to only show body. @@ -19,7 +19,7 @@ ikiwiki (1.17) UNRELEASED; urgency=low * Suck in the page content when generating an inline archive page, to work around the meta plugin's lack of caching of title metadata across runs. - -- Joey Hess Sat, 12 Aug 2006 12:30:48 -0400 + -- Joey Hess Sat, 12 Aug 2006 12:52:13 -0400 ikiwiki (1.16) unstable; urgency=low -- 2.39.5 From 0fd3ec8068d866b1cb87abca5d4534da7818d413 Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 12 Aug 2006 16:56:30 +0000 Subject: [PATCH 03/16] add news item for ikiwiki 1.17 --- doc/news/version_1.14.mdwn | 6 ------ doc/news/version_1.17.mdwn | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) delete mode 100644 doc/news/version_1.14.mdwn create mode 100644 doc/news/version_1.17.mdwn diff --git a/doc/news/version_1.14.mdwn b/doc/news/version_1.14.mdwn deleted file mode 100644 index 081de943e..000000000 --- a/doc/news/version_1.14.mdwn +++ /dev/null @@ -1,6 +0,0 @@ -ikiwiki 1.14 released with these changes: - - * Memoize pagespec translation, this speeds up a build of the ikiwiki tree - by 10% or so. - * Fix stupid bug in date matching, patch from Roland Mas. Closes: #[381132](http://bugs.debian.org/381132) - * Added many unit tests for pagespec\_match. \ No newline at end of file diff --git a/doc/news/version_1.17.mdwn b/doc/news/version_1.17.mdwn new file mode 100644 index 000000000..a7ff27442 --- /dev/null +++ b/doc/news/version_1.17.mdwn @@ -0,0 +1,20 @@ +ikiwiki 1.17 released with these changes: + + * Disable tidy generator tag. + * Move tidy back to sanitize hook, found out how to only show body. + * Turn off tidy indentation too. + * Turn on HTML::Template loop\_context\_vars; not actually used in stock + templates but can be useful for things like making comma-delimited lists + of tags or what have you. + * Remove <br> from end of aggregate preprocessor directive output. + * Ship ikiwiki executable as ikiwiki.pl in source to avoid issues on + case-sensative filesystems like OSX. + * Improve markdown loading. First, try to load it as a proper perl module, + in case it was installed as one. Then fall back to trying + /usr/bin/markdown. + * Document in install page how to install markdown, since it has no + installation procedure in the upstream tarball. + * Set die\_on\_bad\_params => 0 for all templates, to allow users to modify + them without annoyances. + * Suck in the page content when generating an inline archive page, to work + around the meta plugin's lack of caching of title metadata across runs. \ No newline at end of file -- 2.39.5 From d39717a1cb395a45bb794c8141f1ef29f9a00705 Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 12 Aug 2006 17:51:32 +0000 Subject: [PATCH 04/16] * If the meta plugin overides the page title, set a title_overridden variable in the template to true. This allows doing things with the templates conditional on the title being overriden. --- IkiWiki/Plugin/meta.pm | 6 ++++-- debian/changelog | 8 ++++++++ doc/download.mdwn | 4 +++- doc/plugins/meta.mdwn | 4 ++++ doc/plugins/write.mdwn | 8 +------- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 0890830a7..9b026fffa 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -85,8 +85,10 @@ sub pagetemplate (@) { #{{{ $template->param(meta => $meta{$page}) if exists $meta{$page} && $template->query(name => "meta"); - $template->param(title => $title{$page}) - if exists $title{$page} && $template->query(name => "title"); + if (exists $title{$page} && $template->query(name => "title")) { + $template->param(title => $title{$page}); + $template->param(title_overridden => 1); + } $template->param(permalink => $permalink{$page}) if exists $permalink{$page} && $template->query(name => "permalink"); $template->param(author => $author{$page}) diff --git a/debian/changelog b/debian/changelog index 745678056..4e92226fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ikiwiki (1.18) UNRELEASED; urgency=low + + * If the meta plugin overides the page title, set a title_overridden + variable in the template to true. This allows doing things with the + templates conditional on the title being overriden. + + -- Joey Hess Sat, 12 Aug 2006 13:45:05 -0400 + ikiwiki (1.17) unstable; urgency=low * Disable tidy generator tag. diff --git a/doc/download.mdwn b/doc/download.mdwn index 5076c2fe5..55c280984 100644 --- a/doc/download.mdwn +++ b/doc/download.mdwn @@ -13,7 +13,9 @@ If using Debian unstable or testing: Or download the deb from . -While this deb has been developed on Debian unstable, it should also work on stable, although to get the CGI stuff working on stable, you will need to upgrade to a newer version of libcgi-formbuilder-perl, `3.02.02`. +While this deb has been developed on Debian unstable, it should also work +on stable, although to get the CGI stuff working on stable, you will need +to upgrade to a newer version of libcgi-formbuilder-perl, `3.02.02`. # subversion diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index de04dcdd5..de16a9179 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -28,6 +28,10 @@ You can use any field names you like, but here are some predefined ones: Overrides the title of the page, which is generally the same as the page name. + Note that if the title is overrideen, a "title_overridden" variable will + be set to a true value in the template; this can be used to format things + differently in this case. + * license Specifies a copyright license for the page, for example, "GPL". diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 6d9054389..950c4f1f9 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -116,13 +116,7 @@ used to generate the page. The function can manipulate that template object. The most common thing to do is probably to call $template->param() to add -a new custom parameter to the template. Note that in order to be robust, -it's a good idea to check whether the template has a variable before trying -to set it, as setting a variable that's not present is an error. - - if ($template->query(name => 'foo')) { - $template->param("foo" => "bar"); - } +a new custom parameter to the template. ## sanitize -- 2.39.5 From 85ecbc6c4ea3af0b39034d985d4ca4adb243d94f Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 12 Aug 2006 18:00:17 +0000 Subject: [PATCH 05/16] meh --- doc/todo/case.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/todo/case.mdwn b/doc/todo/case.mdwn index 34a3d81d1..6148b48e9 100644 --- a/doc/todo/case.mdwn +++ b/doc/todo/case.mdwn @@ -7,5 +7,5 @@ Also, newly created pagenames that include upper case characters should perhaps not automatically be converted to lower case then. Also, it's currently possible to check in a filename with uppercase and -ikiwiki will render it that way, but fail to edit it online and probably in -other ways. +ikiwiki will render it that way, but fail to edit it online, fail to link to +it properly from other pages, etc. -- 2.39.5 From 4b36dee35a55b08d6d6f3bb3840220a4956f2540 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 02:03:43 +0000 Subject: [PATCH 06/16] * The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed. * Add --version. * Man page format fixups. * Add a %pagecase which maps lower-case page names to the actual case used in the filename. Use this in bestlinks calculation instead of forcing the link to lowercase. * Also use %pagecase in various other places that want to check if a page with a given name exists. * This means that links to pages with mixed case names will now work, even if the link is in some other case mixture, and mixed case pages should be fully supported throughout ikiwiki. * Recommend rebuilding wikis on upgrade to this version. --- IkiWiki.pm | 13 ++++++++----- IkiWiki/CGI.pm | 15 +++++++-------- IkiWiki/Plugin/aggregate.pm | 3 +-- IkiWiki/Render.pm | 1 + Makefile.PL | 8 +++++++- basewiki/wikilink.mdwn | 13 +++++++------ debian/changelog | 16 ++++++++++++++-- debian/postinst | 2 +- doc/freesoftware.mdwn | 2 +- doc/todo/Case.mdwn | 4 ++++ doc/todo/case.mdwn | 11 ----------- doc/usage.mdwn | 8 ++++++-- ikiwiki.pl | 8 +++++++- mdwn2man | 6 +++++- t/bestlink.t | 9 ++++++--- t/linkify.t | 4 ++-- 16 files changed, 77 insertions(+), 46 deletions(-) create mode 100644 doc/todo/Case.mdwn delete mode 100644 doc/todo/case.mdwn diff --git a/IkiWiki.pm b/IkiWiki.pm index 69452792c..560647e06 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -12,7 +12,7 @@ use Memoize; memoize("abs2rel"); memoize("pagespec_translate"); -use vars qw{%config %links %oldlinks %oldpagemtime %pagectime +use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase %renderedfiles %pagesources %depends %hooks %forcerebuild}; sub defaultconfig () { #{{{ @@ -238,7 +238,7 @@ sub bestlink ($$) { #{{{ # goes down the directory tree to the base looking for matching # pages. my $page=shift; - my $link=lc(shift); + my $link=shift; my $cwd=$page; do { @@ -247,9 +247,11 @@ sub bestlink ($$) { #{{{ $l.=$link; if (exists $links{$l}) { - #debug("for $page, \"$link\", use $l"); return $l; } + elsif (exists $pagecase{lc $l}) { + return $pagecase{lc $l}; + } } while $cwd=~s!/?[^/]+$!!; #print STDERR "warning: page $page, broken link: $link\n"; @@ -333,7 +335,7 @@ sub htmllink ($$$;$$$) { #{{{ } if (! grep { $_ eq $bestlink } values %renderedfiles) { return " "create", page => $link, from => $page). + cgiurl(do => "create", page => lc($link), from => $page). "\">?$linktext" } @@ -395,6 +397,7 @@ sub loadindex () { #{{{ $links{$page}=[@{$items{link}}]; $depends{$page}=$items{depends}[0] if exists $items{depends}; $renderedfiles{$page}=$items{dest}[0]; + $pagecase{lc $page}=$page; } $pagectime{$page}=$items{ctime}[0]; } @@ -588,7 +591,7 @@ sub match_glob ($$) { #{{{ sub match_link ($$) { #{{{ my $page=shift; - my $link=shift; + my $link=lc(shift); my $links = $links{$page} or return undef; foreach my $p (@$links) { diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index f69f02a15..db97740f6 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -346,12 +346,11 @@ sub cgi_editpage ($$) { #{{{ # This untaint is safe because titlepage removes any problematic # characters. my ($page)=$form->field('page'); - $page=titlepage(possibly_foolish_untaint(lc($page))); + $page=titlepage(possibly_foolish_untaint($page)); if (! defined $page || ! length $page || $page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) { error("bad page name"); } - $page=lc($page); my $from; if (defined $form->field('from')) { @@ -359,7 +358,7 @@ sub cgi_editpage ($$) { #{{{ } my $file; - my $type; + my $type; if (exists $pagesources{$page}) { $file=$pagesources{$page}; $type=pagetype($file); @@ -457,7 +456,7 @@ sub cgi_editpage ($$) { #{{{ } @page_locs = grep { - ! exists $pagesources{lc($_)} && + ! exists $pagecase{lc $_} && ! page_locked($_, $session, 1) } @page_locs; @@ -485,8 +484,8 @@ sub cgi_editpage ($$) { #{{{ if (! defined $form->field('editcontent') || ! length $form->field('editcontent')) { my $content=""; - if (exists $pagesources{lc($page)}) { - $content=readfile(srcfile($pagesources{lc($page)})); + if (exists $pagesources{$page}) { + $content=readfile(srcfile($pagesources{$page})); $content=~s/\n/\r\n/g; } $form->field(name => "editcontent", value => $content, @@ -617,11 +616,11 @@ sub cgi () { #{{{ cgi_prefs($q, $session); } elsif ($do eq 'blog') { - my $page=titlepage(lc($q->param('title'))); + my $page=titlepage($q->param('title')); # if the page already exists, munge it to be unique my $from=$q->param('from'); my $add=""; - while (exists $oldpagemtime{"$from/$page$add"}) { + while (exists $pagecase{lc "$from/$page$add"}) { $add=1 unless length $add; $add++; } diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 633618f76..2e4026757 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -260,13 +260,12 @@ sub add_page (@) { #{{{ # directory name or trigger ".." disallowing code. $page=~s!([/.])!"__".ord($1)."__"!eg; $page=$feed->{dir}."/".$page; - $page=lc($page); ($page)=$page=~/$IkiWiki::config{wiki_file_regexp}/; if (! defined $page || ! length $page) { $page=$feed->{dir}."/item"; } my $c=""; - while (exists $IkiWiki::pagesources{$page.$c} || + while (exists $IkiWiki::pagecase{lc $page} || -e pagefile($page.$c)) { $c++ } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index b855d2c8f..b4b95e8d4 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -358,6 +358,7 @@ sub refresh () { #{{{ debug("new page $page") unless exists $pagectime{$page}; push @add, $file; $links{$page}=[]; + $pagecase{lc $page}=$page; $pagesources{$page}=$file; if ($config{getctime} && -e "$config{srcdir}/$file") { $pagectime{$page}=rcs_getctime("$config{srcdir}/$file"); diff --git a/Makefile.PL b/Makefile.PL index 7b61acc61..1f46e9c95 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,6 +11,11 @@ clean:: extra_clean install:: extra_install pure_install:: extra_install +VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/' ikiwiki + extra_build: ./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \ --wikiname="ikiwiki" --verbose --no-rcs \ @@ -50,5 +55,6 @@ extra_install: WriteMakefile( 'NAME' => 'IkiWiki', 'PM_FILTER' => 'grep -v "removed by Makefile"', - 'EXE_FILES' => ['ikiwiki.pl'], + 'EXE_FILES' => ['ikiwiki'], + 'clean' => {FILES => 'ikiwiki'}, ); diff --git a/basewiki/wikilink.mdwn b/basewiki/wikilink.mdwn index 21f10a7dd..a3730bcf7 100644 --- a/basewiki/wikilink.mdwn +++ b/basewiki/wikilink.mdwn @@ -5,15 +5,16 @@ For example "\[[WikiLink]]". If you ever need to write something like "\[[WikiLink]] without creating a wikilink, just prefix it with a "\", like "\\\\[[WikiLink]]". -Note that there are some special [[SubPage/LinkingRules]] that come into -play when linking between [[SubPage]]s. +There are some special [[SubPage/LinkingRules]] that come into play when +linking between [[SubPage]]s. -WikiLinks can be entered in any case you like, the page they link to is -always lowercased. - -Note that if the file linked to by a WikiLink looks like an image, it will +Also, iIf the file linked to by a WikiLink looks like an image, it will be displayed inline on the page. +WikiLinks are matched with page names in a case-insensative manner, so you +don't need to worry about getting the case the same, and can capitalise +links at the start of a sentence, and so on. + It's also possible to write a WikiLink that uses something other than the page name as the link text. For example "\[[foo_bar|SandBox]]" links to the SandBox page, but the link will appear like this: [[foo_bar|SandBox]] diff --git a/debian/changelog b/debian/changelog index 4e92226fa..29316cc7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,22 @@ ikiwiki (1.18) UNRELEASED; urgency=low + * The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed. + * Add --version. + * Man page format fixups. * If the meta plugin overides the page title, set a title_overridden variable in the template to true. This allows doing things with the templates conditional on the title being overriden. - - -- Joey Hess Sat, 12 Aug 2006 13:45:05 -0400 + * Add a %pagecase which maps lower-case page names to the actual case + used in the filename. Use this in bestlinks calculation instead of + forcing the link to lowercase. + * Also use %pagecase in various other places that want to check if a page + with a given name exists. + * This means that links to pages with mixed case names will now work, + even if the link is in some other case mixture, and mixed case pages + should be fully supported throughout ikiwiki. + * Recommend rebuilding wikis on upgrade to this version. + + -- Joey Hess Sat, 12 Aug 2006 21:26:29 -0400 ikiwiki (1.17) unstable; urgency=low diff --git a/debian/postinst b/debian/postinst index b3031bd9b..f7043ecad 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e # Change this when some incompatible change is made that requires # rebuilding all wikis. -firstcompat=1.13 +firstcompat=1.18 if [ "$1" = configure ] && \ dpkg --compare-versions "$2" lt "$firstcompat"; then diff --git a/doc/freesoftware.mdwn b/doc/freesoftware.mdwn index bcbfe38dc..5d231de58 100644 --- a/doc/freesoftware.mdwn +++ b/doc/freesoftware.mdwn @@ -1 +1 @@ -ikiwiki is licensed under the terms of the GNU [GPL](GPL). \ No newline at end of file +ikiwiki is licensed under the terms of the GNU [[GPL]]. diff --git a/doc/todo/Case.mdwn b/doc/todo/Case.mdwn new file mode 100644 index 000000000..a19dbb2a6 --- /dev/null +++ b/doc/todo/Case.mdwn @@ -0,0 +1,4 @@ +ikiwiki should support pages that have uppercase in their filenames. +However, links to such pages should not need to exactly preserve the case. + +[[todo/done]] diff --git a/doc/todo/case.mdwn b/doc/todo/case.mdwn deleted file mode 100644 index 6148b48e9..000000000 --- a/doc/todo/case.mdwn +++ /dev/null @@ -1,11 +0,0 @@ -Being case insensative is handy, but it does make the [[BackLinks]] and -[[blog]] links a bit ugly compared to other links. It should be possible to -support pagenames that have uppercase, while still allowing them to be -linked to using any case. - -Also, newly created pagenames that include upper case characters should -perhaps not automatically be converted to lower case then. - -Also, it's currently possible to check in a filename with uppercase and -ikiwiki will render it that way, but fail to edit it online, fail to link to -it properly from other pages, etc. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index aab5330b6..048072df6 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -75,6 +75,10 @@ These options control the mode that ikiwiki is operating in. along with this one. --rebuild will also force feeds to be polled even if they were polled recently. +* --version + + Print ikiwiki version number. + # CONFIG OPTIONS These options configure the wiki. Note that plugins can add additional @@ -160,7 +164,7 @@ configuration options of their own. Specifies the url to the ikiwiki [[CGI]] script wrapper. Required when building the wiki for links to the cgi script to be generated. -* --historyurl http://url/trunk/\[[file]]?root=wiki +* --historyurl url Specifies the url to link to for page history browsing. In the url, "\[[file]]" is replaced with the file to browse. It's common to use @@ -170,7 +174,7 @@ configuration options of their own. Specifies the email address that ikiwiki should use for sending email. -* --diffurl http://url/trunk/\[[file]]?root=wiki&r1=\[[r1]]&r2=\[[r2]] +* --diffurl url Specifies the url to link to for a diff of changes to a page. In the url, "\[[file]]" is replaced with the file to browse, "\[[r1]]" is the old diff --git a/ikiwiki.pl b/ikiwiki.pl index 1342ec543..fd9300fba 100755 --- a/ikiwiki.pl +++ b/ikiwiki.pl @@ -3,6 +3,8 @@ $ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; delete @ENV{qw{IFS CDPATH ENV BASH_ENV}}; package IkiWiki; +our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE + use warnings; use strict; use lib '.'; # For use without installation, removed by Makefile. @@ -65,7 +67,11 @@ sub getconfig () { #{{{ }, "pingurl" => sub { push @{$config{pingurl}}, $_[1]; - } + }, + "version" => sub { + print "ikiwiki version $version\n"; + exit; + }, ) || usage(); if (! $config{setup}) { diff --git a/mdwn2man b/mdwn2man index 8c70c87c1..e78a4d18c 100755 --- a/mdwn2man +++ b/mdwn2man @@ -8,8 +8,12 @@ print ".TH $prog $section\n"; while (<>) { s{(\\?)\[\[([^\s\]]+)\]\]}{$1 ? "[[$2]]" : $2}eg; - s/^#\s/.SH /; + if (/^#\s/) { + s/^#\s/.SH /; + <>; # blank; + } s/^\s+//; + s/-/\\-/g; s/^Warning:.*//g; s/^$/.PP\n/; s/\`//g; diff --git a/t/bestlink.t b/t/bestlink.t index ed748b0f2..825c88ff2 100755 --- a/t/bestlink.t +++ b/t/bestlink.t @@ -1,16 +1,16 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 5; +use Test::More tests => 8; sub test ($$$) { my $page=shift; my $link=shift; my @existing_pages=@{shift()}; - %IkiWiki::links=(); + %IkiWiki::pagecase=(); foreach my $page (@existing_pages) { - $IkiWiki::links{$page}=[]; + $IkiWiki::pagecase{lc $page}=$page; } return IkiWiki::bestlink($page, $link); @@ -20,5 +20,8 @@ BEGIN { use_ok("IkiWiki"); } is(test("bar", "foo", ["bar"]), "", "broken link"); is(test("bar", "foo", ["bar", "foo"]), "foo", "simple link"); +is(test("bar", "FoO", ["bar", "foo"]), "foo", "simple link with different input case"); +is(test("bar", "foo", ["bar", "fOo"]), "fOo", "simple link with different page case"); +is(test("bar", "FoO", ["bar", "fOo"]), "fOo", "simple link with different page and input case"); is(test("bar", "foo", ["bar", "foo", "bar/foo"]), "bar/foo", "simple subpage link"); is(test("bar", "foo/subpage", ["bar", "foo", "bar/subpage", "foo/subpage"]), "foo/subpage", "cross subpage link"); diff --git a/t/linkify.t b/t/linkify.t index d1d02cd27..82f5f368b 100755 --- a/t/linkify.t +++ b/t/linkify.t @@ -12,9 +12,9 @@ sub linkify ($$$$) { # This is what linkify and htmllink need set right now to work. # This could change, if so, update it.. - %IkiWiki::links=(); + %IkiWiki::pagecase=(); foreach my $page (@existing_pages) { - $IkiWiki::links{$page}=[]; + $IkiWiki::pagecase{lc $page}=$page; $IkiWiki::renderedfiles{"$page.mdwn"}=$page; } %IkiWiki::config=IkiWiki::defaultconfig(); -- 2.39.5 From fcf3894e807958a40cd50aa350dbec21fb7410e2 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 02:08:42 +0000 Subject: [PATCH 07/16] update --- t/bestlink.t | 5 ++++- t/linkify.t | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/t/bestlink.t b/t/bestlink.t index 825c88ff2..ece900152 100755 --- a/t/bestlink.t +++ b/t/bestlink.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 8; +use Test::More tests => 9; sub test ($$$) { my $page=shift; @@ -9,8 +9,10 @@ sub test ($$$) { my @existing_pages=@{shift()}; %IkiWiki::pagecase=(); + %IkiWiki::links=(); foreach my $page (@existing_pages) { $IkiWiki::pagecase{lc $page}=$page; + $IkiWiki::links{$page}=[]; } return IkiWiki::bestlink($page, $link); @@ -23,5 +25,6 @@ is(test("bar", "foo", ["bar", "foo"]), "foo", "simple link"); is(test("bar", "FoO", ["bar", "foo"]), "foo", "simple link with different input case"); is(test("bar", "foo", ["bar", "fOo"]), "fOo", "simple link with different page case"); is(test("bar", "FoO", ["bar", "fOo"]), "fOo", "simple link with different page and input case"); +is(test("bar", "Foo", ["bar", "fOo", "foo", "fOO", "Foo", "fOo"]), "Foo", "in case of ambiguity, like case wins"); is(test("bar", "foo", ["bar", "foo", "bar/foo"]), "bar/foo", "simple subpage link"); is(test("bar", "foo/subpage", ["bar", "foo", "bar/subpage", "foo/subpage"]), "foo/subpage", "cross subpage link"); diff --git a/t/linkify.t b/t/linkify.t index 82f5f368b..2ed3face3 100755 --- a/t/linkify.t +++ b/t/linkify.t @@ -13,8 +13,10 @@ sub linkify ($$$$) { # This is what linkify and htmllink need set right now to work. # This could change, if so, update it.. %IkiWiki::pagecase=(); + %IkiWiki::links=(); foreach my $page (@existing_pages) { $IkiWiki::pagecase{lc $page}=$page; + $IkiWiki::links{$page}=[]; $IkiWiki::renderedfiles{"$page.mdwn"}=$page; } %IkiWiki::config=IkiWiki::defaultconfig(); -- 2.39.5 From dd74a51c96d4cdee2bfc741e5aec0a378e2c644f Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 02:19:52 +0000 Subject: [PATCH 08/16] releasing version 1.18 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 29316cc7a..0efb4f6b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (1.18) UNRELEASED; urgency=low +ikiwiki (1.18) unstable; urgency=low * The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed. * Add --version. @@ -16,7 +16,7 @@ ikiwiki (1.18) UNRELEASED; urgency=low should be fully supported throughout ikiwiki. * Recommend rebuilding wikis on upgrade to this version. - -- Joey Hess Sat, 12 Aug 2006 21:26:29 -0400 + -- Joey Hess Sat, 12 Aug 2006 22:10:48 -0400 ikiwiki (1.17) unstable; urgency=low -- 2.39.5 From 9e1c0c5586979f15d651156a3933c56bff26adca Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 02:20:15 +0000 Subject: [PATCH 09/16] add news item for ikiwiki 1.18 --- doc/news/version_1.15.mdwn | 5 ----- doc/news/version_1.18.mdwn | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 doc/news/version_1.15.mdwn create mode 100644 doc/news/version_1.18.mdwn diff --git a/doc/news/version_1.15.mdwn b/doc/news/version_1.15.mdwn deleted file mode 100644 index 8e563c3c8..000000000 --- a/doc/news/version_1.15.mdwn +++ /dev/null @@ -1,5 +0,0 @@ -ikiwiki 1.15 released with these changes: - - * Remove CDPATH and other env vars perl taint checking doesn't like. - Closes: #[381279](http://bugs.debian.org/381279) - * Added created\_before and created\_after PageSpec limits. \ No newline at end of file diff --git a/doc/news/version_1.18.mdwn b/doc/news/version_1.18.mdwn new file mode 100644 index 000000000..0bba5e5e7 --- /dev/null +++ b/doc/news/version_1.18.mdwn @@ -0,0 +1,17 @@ +ikiwiki 1.18 released with these changes: + + * The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed. + * Add --version. + * Man page format fixups. + * If the meta plugin overides the page title, set a title\_overridden + variable in the template to true. This allows doing things with the + templates conditional on the title being overriden. + * Add a %pagecase which maps lower-case page names to the actual case + used in the filename. Use this in bestlinks calculation instead of + forcing the link to lowercase. + * Also use %pagecase in various other places that want to check if a page + with a given name exists. + * This means that links to pages with mixed case names will now work, + even if the link is in some other case mixture, and mixed case pages + should be fully supported throughout ikiwiki. + * Recommend rebuilding wikis on upgrade to this version. \ No newline at end of file -- 2.39.5 From be092a67c22e98885f79936c18529f9fac5c0fe0 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 05:56:01 +0000 Subject: [PATCH 10/16] * Fix a bug in page type determination during online editing. --- IkiWiki/CGI.pm | 4 +--- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index db97740f6..f1f83cfc4 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -372,9 +372,7 @@ sub cgi_editpage ($$) { #{{{ # favor the type of linking page $type=pagetype($pagesources{$from}); } - else { - $type=$config{default_pageext}; - } + $type=$config{default_pageext} unless defined $type; $file=$page.".".$type; } diff --git a/debian/changelog b/debian/changelog index 0efb4f6b1..66336196f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (1.19) UNRELEASED; urgency=low + + * Fix a bug in page type determination during online editing. + + -- Joey Hess Sun, 13 Aug 2006 01:53:02 -0400 + ikiwiki (1.18) unstable; urgency=low * The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed. -- 2.39.5 From d6a576077dafb4c451fdc980f3d7e5a4e7dafec4 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 13 Aug 2006 05:58:36 +0000 Subject: [PATCH 11/16] up --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 66336196f..70a598599 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ ikiwiki (1.19) UNRELEASED; urgency=low - * Fix a bug in page type determination during online editing. + * Fix several related bugs in page type determination during online editing. -- Joey Hess Sun, 13 Aug 2006 01:53:02 -0400 -- 2.39.5 From 19de08212a73cb5a2372499b16bf64891711c7ec Mon Sep 17 00:00:00 2001 From: www-data Date: Mon, 14 Aug 2006 10:42:50 +0000 Subject: [PATCH 12/16] web commit by tuomov: Another approach for darcs/dvcs --- doc/about_rcs_backends.mdwn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/about_rcs_backends.mdwn b/doc/about_rcs_backends.mdwn index 85468bc7c..678be2e57 100644 --- a/doc/about_rcs_backends.mdwn +++ b/doc/about_rcs_backends.mdwn @@ -75,6 +75,30 @@ off from R1. (To be continued.) +#### Another possible approach + +Here's what I (tuomov) think, would be a “cleaner” approach: + + 1. Upon starting to edit, Ikiwiki gets a copy of the page, and `darcs changes --context`. + This context _and_ the present version of the page are stored in as the “version” of the + page in a hidden control of the HTML. + Thus the HTML includes all that is needed to generate a patch wrt. to the state of the + repository at the time the edit was started. This is of course all that darcs needs. + 2. Once the user is done with editing, _Ikiwiki generates a patch bundle_ for darcs. + This should be easy with existing `Text::Diff` or somesuch modules, as the Web edits + only concern single files. The reason why the old version of the page is stored in + the HTML (possibly compressed) is that the diff can be generated. + 3. Now this patch bundle is applied with `darcs apply`, or sent by email for moderation… + there are many possibilities. + +This approach avoids some of the problems of concurrent edits that the previous one may have, +although there may be conflicts, which may or may not propagate to the displayed web page. +(Unfortunately there is not an option to `darcs apply` to generate some sort of ‘confliction resolution +bundle’.) Also, only one repository is needed, as it is never directly modified +by Ikiwiki. + +This approach might be applicable to other distributed VCSs as well, although they're not as oriented +towards transmitting changes with standalone patch bundles (often by email) as darcs is. ## [[Git]] -- 2.39.5 From 3ced1551bbf14153e289a2d4c58e0a4985c03edb Mon Sep 17 00:00:00 2001 From: www-data Date: Mon, 14 Aug 2006 20:44:19 +0000 Subject: [PATCH 13/16] web commit by JonasSmedegaard: Correct typo: perminent -> permanent. --- doc/plugins/meta.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index de16a9179..19262f86b 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -42,7 +42,7 @@ You can use any field names you like, but here are some predefined ones: * permalink - Specifies a perminent link to the page, if different than the page + Specifies a permanent link to the page, if different than the page generated by ikiwiki. If the field is not treated specially (as the link and title fields are), -- 2.39.5 From 543479eb22c43d26f73f2b43dbea45eea6bd56c1 Mon Sep 17 00:00:00 2001 From: www-data Date: Tue, 15 Aug 2006 17:05:32 +0000 Subject: [PATCH 14/16] web commit by neal: Note how wiki links related to file names. --- doc/wikilink.mdwn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/wikilink.mdwn diff --git a/doc/wikilink.mdwn b/doc/wikilink.mdwn new file mode 100644 index 000000000..4b82e7380 --- /dev/null +++ b/doc/wikilink.mdwn @@ -0,0 +1,24 @@ +WikiLinks provide easy linking between pages of the wiki. To create a +[[WikiLink]], just put the name of the page to link to in double brackets. +For example "\[[WikiLink]]". + +Wiki links may not contain spaces. The associated file must be the wiki +link with any capital letters converted to lower case plus the file +extention. + +If you ever need to write something like "\[[WikiLink]] without creating a +wikilink, just prefix it with a "\", like "\\\\[[WikiLink]]". + +There are some special [[SubPage/LinkingRules]] that come into play when +linking between [[SubPage]]s. + +Also, if the file linked to by a WikiLink looks like an image, it will +be displayed inline on the page. + +WikiLinks are matched with page names in a case-insensative manner, so you +don't need to worry about getting the case the same, and can capitalise +links at the start of a sentence, and so on. + +It's also possible to write a WikiLink that uses something other than the +page name as the link text. For example "\[[foo_bar|SandBox]]" links to the +SandBox page, but the link will appear like this: [[foo_bar|SandBox]] -- 2.39.5 From bd8d5a2b57713cae512c4f8dc41fe4b22dcbe941 Mon Sep 17 00:00:00 2001 From: www-data Date: Tue, 15 Aug 2006 17:44:53 +0000 Subject: [PATCH 15/16] web commit by neal --- doc/wikilink.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/wikilink.mdwn b/doc/wikilink.mdwn index 4b82e7380..9586bfa44 100644 --- a/doc/wikilink.mdwn +++ b/doc/wikilink.mdwn @@ -2,9 +2,9 @@ WikiLinks provide easy linking between pages of the wiki. To create a [[WikiLink]], just put the name of the page to link to in double brackets. For example "\[[WikiLink]]". -Wiki links may not contain spaces. The associated file must be the wiki -link with any capital letters converted to lower case plus the file -extention. +The file name associated with a wiki link is create as follows: capital +letters converted to lower case and spaces to underscores. Finally, +the file extention is added. If you ever need to write something like "\[[WikiLink]] without creating a wikilink, just prefix it with a "\", like "\\\\[[WikiLink]]". -- 2.39.5 From 87de5b822bd5ffe77a3bac3a984a9f1e2a3d90d4 Mon Sep 17 00:00:00 2001 From: www-data Date: Tue, 15 Aug 2006 17:45:19 +0000 Subject: [PATCH 16/16] web commit by neal --- doc/wikilink.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/wikilink.mdwn b/doc/wikilink.mdwn index 9586bfa44..d7e2ec6e0 100644 --- a/doc/wikilink.mdwn +++ b/doc/wikilink.mdwn @@ -3,7 +3,7 @@ WikiLinks provide easy linking between pages of the wiki. To create a For example "\[[WikiLink]]". The file name associated with a wiki link is create as follows: capital -letters converted to lower case and spaces to underscores. Finally, +letters are converted to lower case and spaces to underscores. Finally, the file extention is added. If you ever need to write something like "\[[WikiLink]] without creating a -- 2.39.5