Difference between revisions of "Template:Pkg"

From ArchWiki
Jump to: navigation, search
m (style)
(Use {{urlencode}}. Second parameter is now ignored.)
Line 9: Line 9:
 
{{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. See also {{bug|26383}}.}}
 
{{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. See also {{bug|26383}}.}}
  
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:
+
Special characters in the package name are automatically encoded in the URL, for example
  
{{Codeline|<nowiki>{{Pkg|package+|package%2B}}</nowiki>}}
+
{{Codeline|<nowiki>{{Pkg|dvd+rw-tools}}</nowiki>}} → {{Pkg|dvd+rw-tools}}
  
 
====Example====
 
====Example====
  
{{Pkg|package}}</noinclude><includeonly><span style="font-family: monospace">[https://www.archlinux.org/packages/?name={{{2|{{{1}}}}}} {{{1}}}]</span></includeonly>
+
{{Pkg|package}}</noinclude><includeonly><span style="font-family: monospace">[https://www.archlinux.org/packages/?name={{urlencode:{{{1}}}}} {{{1}}}]</span></includeonly>

Revision as of 03:05, 27 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 Repositories.

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. See also FS#26383.

Special characters in the package name are automatically encoded in the URL, for example

Template:Codelinedvd+rw-tools

Example

package