From fa52a730ff3b30c7d2cdd8cd5f9c8c25a0c0a2a5 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 20 Feb 2007 03:05:47 +0000 Subject: * Changed calling convention for httmllink slightly. The first three parameters remain the same, but additional options are now passed in using named parameters. * Change plugin interface version to 1.02 to reflect this change. * Add a new anchor option to htmllink. Thanks Ben for the idea. * Support anchors in wikilinks. * Add a "more" plugin based on one contributed by Ben to allow implementing those dreaded "Read more" links in blogs. --- doc/patchqueue/clickable-openid-urls-in-logs.mdwn | 2 +- doc/patchqueue/htmllink-anchors.mdwn | 29 ----------------- doc/patchqueue/morelink-plugin.mdwn | 39 ----------------------- 3 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 doc/patchqueue/htmllink-anchors.mdwn delete mode 100644 doc/patchqueue/morelink-plugin.mdwn (limited to 'doc/patchqueue') diff --git a/doc/patchqueue/clickable-openid-urls-in-logs.mdwn b/doc/patchqueue/clickable-openid-urls-in-logs.mdwn index 18ba6be94..997bc7492 100644 --- a/doc/patchqueue/clickable-openid-urls-in-logs.mdwn +++ b/doc/patchqueue/clickable-openid-urls-in-logs.mdwn @@ -1,6 +1,6 @@ OpenID URLs aren't clickable in the ViewVC logs because they're directly followed by a colon. At the expense of, um, proper grammar, here's a patch for SVN. If this is OK, I'll patch the other RCS modules, too. -> Reasonable, but probably needs to modify the wiki_commit_regexp to +> Reasonable, but probably needs to modify the wiki\_commit\_regexp to > recognise such commit messages when parsing the logs. Do that and extend > to the other modules and I'll accept it. --[[Joey]] diff --git a/doc/patchqueue/htmllink-anchors.mdwn b/doc/patchqueue/htmllink-anchors.mdwn deleted file mode 100644 index 2bb203f51..000000000 --- a/doc/patchqueue/htmllink-anchors.mdwn +++ /dev/null @@ -1,29 +0,0 @@ -Here's an attempt to make `htmllink` "do the right thing" with in-page anchors: - -
-Index: IkiWiki.pm
-===================================================================
---- IkiWiki.pm  (revision 2657)
-+++ IkiWiki.pm  (working copy)
-@@ -426,6 +426,8 @@
-        my $noimageinline=shift; # don't turn links into inline html images
-        my $forcesubpage=shift; # force a link to a subpage
-        my $linktext=shift; # set to force the link text to something
-+    
-+    my $anchor = ($link =~ s/#(.+)$// ? $1 : undef);
- 
-        my $bestlink;
-        if (! $forcesubpage) {
-@@ -455,7 +457,10 @@
-        if (! $noimageinline && isinlinableimage($bestlink)) {
-                return "\"$linktext\"";
-        }
--       return "$linktext";
-+
-+    $bestlink .= "#$anchor" if $anchor;
-+    
-+    return "$linktext";
- } #}}}
- 
- sub htmlize ($$$) { #{{{
-
\ No newline at end of file diff --git a/doc/patchqueue/morelink-plugin.mdwn b/doc/patchqueue/morelink-plugin.mdwn deleted file mode 100644 index 9724b3e3a..000000000 --- a/doc/patchqueue/morelink-plugin.mdwn +++ /dev/null @@ -1,39 +0,0 @@ -Enables _Read more_ links for use in blog posts. Adds a config option for customising the anchor text. (The [[/patchqueue/htmllink-anchors]] patch is a dependency). - - Index: IkiWiki/Plugin/morelink.pm - =================================================================== - --- IkiWiki/Plugin/morelink.pm (revision 0) - +++ IkiWiki/Plugin/morelink.pm (revision 0) - @@ -0,0 +1,30 @@ - +#!/usr/bin/perl - +package IkiWiki::Plugin::morelink; - + - +use warnings; - +use strict; - +use IkiWiki; - + - +my $linktext = 'Read more'; - + - +sub import { #{{{ - + hook(type => "checkconfig", id => "more", call => \&checkconfig); - + hook(type => "preprocess", id => "more", call => \&preprocess); - +} # }}} - + - +sub checkconfig () { #{{{ - + $linktext = $config{morelink_text} || $linktext; - +} #}}} - + - +sub preprocess (@) { #{{{ - + my %args = @_; - + - + if ($args{page} ne $args{destpage}) { - + return "\n".htmllink($args{page}, $args{destpage}, $args{page}.'#more', 0, 0, $linktext); - + } - + else { - + return "".$args{text}; - + } - +} - + - +1 - ---Ben \ No newline at end of file -- cgit v1.2.3