Difference between revisions of "Template:Pkg"

From ArchWiki
Jump to: navigation, search
(use new "name" search option (FS#26383) -- search pkgname field rather than pkgname and pkgdesc)
Line 5: Line 5:
 
====Usage====
 
====Usage====
  
{{Codeline|1=<nowiki>{{Pkg|package}}</nowiki>}}
+
{{Codeline|<nowiki>{{Pkg|package}}</nowiki>}}
  
 
{{Note|This template will ''search'' for {{Codeline|package}} in the official repos. Thus, if {{Codeline|package-''foo''}} and {{Codeline|package-''bar''}} exist, all matching variations will be listed. In cases where the package name is ambiguous (e.g. {{Package Official|tea}}, which matches '''''tea'''''ser, ins'''''tea'''''d, etc.) a direct link may be preferred.}}
 
{{Note|This template will ''search'' for {{Codeline|package}} in the official repos. Thus, if {{Codeline|package-''foo''}} and {{Codeline|package-''bar''}} exist, all matching variations will be listed. In cases where the package name is ambiguous (e.g. {{Package Official|tea}}, which matches '''''tea'''''ser, ins'''''tea'''''d, etc.) a direct link may be preferred.}}
 +
 +
In cases where the package name contains characters not allowed in the URL, you should use the second optional argument to provide the correctly-encoded string:
 +
 +
{{Codeline|<nowiki>{{Pkg|package+|package%2B}}</nowiki>}}
  
 
====Example====
 
====Example====
  
{{Pkg|package}}</noinclude><includeonly><span style="font-family: monospace">[https://www.archlinux.org/packages/?name={{{1}}} {{{1}}}]</span></includeonly>
+
{{Pkg|package}}</noinclude><includeonly><span style="font-family: monospace">[https://www.archlinux.org/packages/?name={{{2|{{{1}}}}}} {{{1}}}]</span></includeonly>

Revision as of 12:31, 21 October 2011

This page is a template. It contains no Arch Linux-related information, but should be used as part of other articles. For more information, read Help:Template.

Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.

Feel free to voice your opinion regarding this template.

An inline link to search for the given package in the official repos.

Usage

Template:Codeline

Note: This template will search for Template:Codeline in the official repos. Thus, if Template:Codeline and Template:Codeline exist, all matching variations will be listed. In cases where the package name is ambiguous (e.g. Template:Package Official, which matches teaser, instead, etc.) a direct link may be preferred.

In cases where the package name contains characters not allowed in the URL, you should use the second optional argument to provide the correctly-encoded string:

Template:Codeline

Example

package