aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/shortcut.pm13
-rwxr-xr-xMakefile.PL2
-rw-r--r--basewiki/shortcuts.mdwn7
-rw-r--r--debian/changelog5
-rw-r--r--doc/install.mdwn22
-rw-r--r--doc/plugins/ddate.mdwn4
-rw-r--r--doc/plugins/htmlscrubber.mdwn2
-rw-r--r--doc/plugins/openid.mdwn6
-rw-r--r--doc/plugins/template.mdwn7
-rw-r--r--doc/plugins/wikitext.mdwn6
-rw-r--r--doc/todo/shortcut_link_text.mdwn20
11 files changed, 62 insertions, 32 deletions
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm
index d09d5879d..e4a9ab1a6 100644
--- a/IkiWiki/Plugin/shortcut.pm
+++ b/IkiWiki/Plugin/shortcut.pm
@@ -25,14 +25,14 @@ sub preprocess_shortcut (@) { #{{{
}
hook(type => "preprocess", no_override => 1, id => $params{name},
- call => sub { shortcut_expand($params{name}, $params{url}, @_) });
+ call => sub { shortcut_expand($params{url}, $params{desc}, @_) });
return "shortcut $params{name} points to $params{url}";
} # }}}
sub shortcut_expand ($$@) { #{{{
- my $name=shift;
my $url=shift;
+ my $desc=shift;
my %params=@_;
# Get params in original order.
@@ -51,8 +51,15 @@ sub shortcut_expand ($$@) { #{{{
my $encoded_text=$text;
$encoded_text=~s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
+ if (defined $desc) {
+ $desc=~s/\%s/$text/g;
+ }
+ else {
+ $desc=$text;
+ }
+
$url=~s/\%s/$encoded_text/g;
- return "<a href=\"$url\">$text</a>";
+ return "<a href=\"$url\">$desc</a>";
} #}}}
1
diff --git a/Makefile.PL b/Makefile.PL
index b27e6cef3..831c13255 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -21,7 +21,7 @@ extra_build:
--plugin=orphans --plugin=haiku --plugin=meta \
--plugin=tag --plugin=polygen --plugin=pagestats \
--plugin=fortune --plugin=aggregate --plugin=map \
- --plugin=template --plugin=toc
+ --plugin=template --plugin=toc --plugin=shortcut
./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
./pm_filter $(PREFIX) $(VER) < ikiwiki.pl > ikiwiki.out
diff --git a/basewiki/shortcuts.mdwn b/basewiki/shortcuts.mdwn
index cb80c4d40..cca0df4a3 100644
--- a/basewiki/shortcuts.mdwn
+++ b/basewiki/shortcuts.mdwn
@@ -2,8 +2,9 @@ This page controls what shortcut links the wiki supports.
* [[shortcut name=google url="http://www.google.com/search?q=%s"]]
* [[shortcut name=wikipedia url="http://en.wikipedia.org/wiki/%s"]]
-* [[shortcut name=debbug url="http://bugs.debian.org/%s"]]
+* [[shortcut name=debbug url="http://bugs.debian.org/%s" desc="bug #%s"]]
* [[shortcut name=cpan url="http://search.cpan.org/search?mode=dist&query=%s"]]
-To add a new shortcut, use the "shortcut" preprocessor directive. "%s" in
-the url becomes the text passed to the named shortcut.
+To add a new shortcut, use the "shortcut" preprocessor directive. "%s" is
+replaced with the text passed to the named shortcut. The optional desc
+parameter controls the description of the link.
diff --git a/debian/changelog b/debian/changelog
index 5317c4755..d38152132 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,12 +7,13 @@ ikiwiki (1.34) UNRELEASED; urgency=low
* Modified svn, git, tla backends to recognise such web commits.
* Move httpauth support to a plugin.
* Add openidsignup config option.
- * Make the openid plugin support the callbacks from myopenid.com via its
+ * Make the openid plugin support the callbacks from myopenid.com via its
affiliate program.
* Change how post signin actions are propigated through the signin process;
they're now stored in the session.
+ * Add optional "desc" parameter to shortcut definitions.
- -- Joey Hess <joeyh@debian.org> Sun, 19 Nov 2006 16:40:26 -0500
+ -- Joey Hess <joeyh@debian.org> Mon, 20 Nov 2006 06:14:51 -0500
ikiwiki (1.33) unstable; urgency=low
diff --git a/doc/install.mdwn b/doc/install.mdwn
index 08a446fb8..ed6d499c5 100644
--- a/doc/install.mdwn
+++ b/doc/install.mdwn
@@ -5,14 +5,16 @@ most unix-like systems.
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 the `Text::MarkDown`, `URI` and `HTML::Parser` perl
-modules be installed, and also uses the following perl modules if
-available:
-`CGI::Session` `CGI::FormBuilder` (version 3.02.02 or newer)
-`HTML::Template` `Mail::Sendmail` `Time::Duration` `Date::Parse`,
-`HTML::Scrubber`, `RPC::XML`, `XML::Simple`, `XML::Feed`, `File::MimeInfo`.
+Ikiwiki requires the [[cpan Text::MarkDown]], [[cpan URI]] and
+[[cpan HTML::Parser]] perl modules be installed, and also uses the
+following perl modules if available:
+[[cpan CGI::Session]], [[cpan CGI::FormBuilder]] (version 3.02.02 or newer,
+but 3.0401 might be broken),
+[[cpan HTML::Template]], [[cpan Mail::Sendmail]], [[cpan Time::Duration]]
+[[cpan TimeDate]], [[cpan HTML::Scrubber]], [[cpan RPC::XML]],
+[[cpan XML::Simple]], [[cpan XML::Feed]], [[cpan File::MimeInfo]].
-The [[tla]] support also needs the `MailTools` perl module.
+The [[tla]] support also needs the [[cpan MailTools]] perl module.
Various [[plugins]] use other libraries and utlities; see their individual
documentation for details.
@@ -20,9 +22,9 @@ documentation for details.
If you want to install from the tarball, you should make sure that the
required perl modules are installed, then run:
- perl Makefile.PL # PREFIX=/dir to install elsewhere
- make
+ perl Makefile.PL # PREFIX=/dir to install elsewhere
+ make
make test # optional
- make install
+ make install
See [[download]] for where to get it.
diff --git a/doc/plugins/ddate.mdwn b/doc/plugins/ddate.mdwn
index c35afe4ca..307673048 100644
--- a/doc/plugins/ddate.mdwn
+++ b/doc/plugins/ddate.mdwn
@@ -4,5 +4,5 @@
Enables use of Discordian dates. `--timeformat` can be used to change
the date format; see `ddate(1)`.
-This plugin requires the DateTime and DateTime::Calendar::Discordian
-perl modules.
+This plugin requires the [[cpan DateTime]] and
+[[cpan DateTime::Calendar::Discordian]] perl modules.
diff --git a/doc/plugins/htmlscrubber.mdwn b/doc/plugins/htmlscrubber.mdwn
index e3652a847..a064c4901 100644
--- a/doc/plugins/htmlscrubber.mdwn
+++ b/doc/plugins/htmlscrubber.mdwn
@@ -10,7 +10,7 @@ whitelisted using the same lists as used by Mark Pilgrim's Universal Feed
Parser, documented at <http://feedparser.org/docs/html-sanitization.html>.
Notably it strips `style`, `link`, and the `style` attribute.
-It uses the HTML::Scrubber perl module to perform its html
+It uses the [[cpan HTML::Scrubber]] perl module to perform its html
sanitisation, and this perl module also deals with various entity encoding
tricks.
diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn
index 133529ea7..a6e01ccc5 100644
--- a/doc/plugins/openid.mdwn
+++ b/doc/plugins/openid.mdwn
@@ -4,9 +4,9 @@
This plugin allows users to use their [OpenID](http://openid.net/) to log
into the wiki.
-The plugin needs the `Net::OpenID::Consumer` perl module. The
-`LWPx::ParanoidAgent` perl module is used if available, for added
-security. Finally, the `Crypt::SSLeay` perl module is needed to support
+The plugin needs the [[cpan Net::OpenID::Consumer]] perl module. The
+[[cpan LWPx::ParanoidAgent]] perl module is used if available, for added
+security. Finally, the [[cpan Crypt::SSLeay]] perl module is needed to support
users entering "https" OpenID urls.
This plugin has a configuration option. You can set `--openidsignup`
diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn
index 8b089d904..7b70bb281 100644
--- a/doc/plugins/template.mdwn
+++ b/doc/plugins/template.mdwn
@@ -27,9 +27,10 @@ To create a template, make a page in the wiki named `template/foo`. Note
that this is a different location than the directory used for the
[[templates]] used to build the wiki itself, which is not inside the wiki.
-The template uses the syntax used by the HTML::Template perl module, which
-allows for some fairly complex things to be done. Consult its documentation
-for the full syntax, but all you really need to know are a few things:
+The template uses the syntax used by the [[cpan HTML::Template]] perl
+module, which allows for some fairly complex things to be done. Consult its
+documentation for the full syntax, but all you really need to know are a
+few things:
* To insert the value of a variable, use `<TMPL_VAR variable>`.
* To make a block of text conditional on a variable being set use
diff --git a/doc/plugins/wikitext.mdwn b/doc/plugins/wikitext.mdwn
index d7768f0f8..abbebb677 100644
--- a/doc/plugins/wikitext.mdwn
+++ b/doc/plugins/wikitext.mdwn
@@ -2,9 +2,9 @@
[[tag type/format]]
This plugin allows ikiwiki to process pages written in the original wiki
-text format. To use it, you need to have the Text::WikiFormat perl module
-installed, enable the plugin, then files with the extention `.wiki` will be
-processed as wiki text.
+text format. To use it, you need to have the [[cpan Text::WikiFormat]] perl
+module installed, enable the plugin, then files with the extention `.wiki`
+will be processed as wiki text.
Wiki formatting is very simple. An item wrapped in three single quotes is
strong. An item wrapped in two single quotes is emphasized. Four or more
diff --git a/doc/todo/shortcut_link_text.mdwn b/doc/todo/shortcut_link_text.mdwn
index 31820836b..6842a911f 100644
--- a/doc/todo/shortcut_link_text.mdwn
+++ b/doc/todo/shortcut_link_text.mdwn
@@ -1 +1,19 @@
-[[plugins/shortcut]] creates link shortcut [[PreprocessorDirective]]s, which substitute their argument into the specified shortcut URL to generate the link target, and use the argument as the link text. For example, given the example [[shortcuts]], `\[[wikipedia ikiwiki]]` generates a link to <http://en.wikipedia.org/wiki/ikiwiki>, with the link text "ikiwiki". This works well in many cases; however, for things like the `debbug` example, it simply uses the number as the link text, which does not always provide enough context to understand the link at first glance. For example, `\[[debbug 397501]]` generates a link to <http://bugs.debian.org/397501>, with just "397501" as the link text. While [[plugins/template]] provides a general solution for arbitrary cases, it would help to have a simple option via the shortcut plugin to set the link text, with a `%s` substitution. Thus, something like `\[[shortcut name=debbug url="http://bugs.debian.org/%s" desc="bug #%s"]]` might suffice on a Debian-specific wiki to indicate a bug number, while a more general wiki might use something like `\[[shortcut name=debbug url="http://bugs.debian.org/%s" desc="Debian bug #%s"]]`. \ No newline at end of file
+[[plugins/shortcut]] creates link shortcut [[PreprocessorDirective]]s,
+which substitute their argument into the specified shortcut URL to generate
+the link target, and use the argument as the link text. For example, given
+the example [[shortcuts]], `\[[wikipedia ikiwiki]]` generates a link to
+<http://en.wikipedia.org/wiki/ikiwiki>, with the link text "ikiwiki". This
+works well in many cases; however, for things like the `debbug` example, it
+simply uses the number as the link text, which does not always provide
+enough context to understand the link at first glance. For example,
+`\[[debbug 397501]]` generates a link to <http://bugs.debian.org/397501>,
+with just "397501" as the link text. While [[plugins/template]] provides a
+general solution for arbitrary cases, it would help to have a simple option
+via the shortcut plugin to set the link text, with a `%s` substitution.
+Thus, something like `\[[shortcut name=debbug
+url="http://bugs.debian.org/%s" desc="bug #%s"]]` might suffice on a
+Debian-specific wiki to indicate a bug number, while a more general wiki
+might use something like `\[[shortcut name=debbug
+url="http://bugs.debian.org/%s" desc="Debian bug #%s"]]`.
+
+> [[todo/done]] --[[Joey]]