1 Consider the "All files in this package search" on
2 <http://packages.debian.org>. The URL for such a search looks like this:
4 http://packages.debian.org/cgi-bin/search_contents.pl?word=packagename&searchmode=filelist&case=insensitive&version=unstable&arch=i386
6 To create a "debfiles" [[shortcut|shortcuts]] that takes a package name, you
7 could just hardcode the architecture and distribution:
9 \[[shortcut name=debfiles url="http://packages.debian.org/cgi-bin/search_contents.pl?word=%s&searchmode=filelist&case=insensitive&version=unstable&arch=i386"]]
12 But what if you could have them as optional parameters instead? The syntax
13 for the invocation should look like this:
15 \[[debfiles ikiwiki dist=testing]]
17 Some possible syntax choices for the shortcut definition:
19 \[[shortcut name=debfiles url="http://packages.debian.org/cgi-bin/search_contents.pl?word=%s&searchmode=filelist&case=insensitive&version=%(dist)s&arch=%(arch)s" dist="unstable" arch="i386"]]
20 \[[shortcut name=debfiles url="http://packages.debian.org/cgi-bin/search_contents.pl?word=%s&searchmode=filelist&case=insensitive&version=%(dist=unstable)s&arch=%(arch=i386)s"]]
21 \[[shortcut name=debfiles url="http://packages.debian.org/cgi-bin/search_contents.pl?word=%s&searchmode=filelist&case=insensitive&version=%{dist=unstable}&arch=%{arch=i386}"]]
22 \[[shortcut name=debfiles url="http://packages.debian.org/cgi-bin/search_contents.pl?word=$*&searchmode=filelist&case=insensitive&version=${dist=unstable}&arch=${arch=i386}"]]
26 Well, you can already do this kind of thing with templates. Invocation does
29 \[[template id=debfiles package=ikiwiki dist=testing]]