Template:Sandbox: Difference between revisions

From Alpine Linux
m (Corrected documentation for branch parameter.)
m (Add documentation...)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{{1}}} | short = 3.20 | v = v3.20 | 3.20.3 }}</includeonly>
<noinclude><!--                          ^^^^      ^^^^^  ^^^^^^
When updating this template, the latest version string must be changed three times, two lines above this comment
The first is the short version (major.minor)
The second is the short version prefixed with a lowercase v (vmajor.minor)
The final is the full version string (major.minor.patchlevel)--></noinclude>
<noinclude>{{Template}}
<noinclude>{{Template}}
An inline link to search for given packages in the Package Browser.
This template produces a string containing the latest version of Alpine Linux


=== Usage ===
=== Usage ===
<pre>{{Pkg|package|branch=|repo=|arch=|maintainer=}}</pre>
<pre>{{AlpineLatest|short|v}}</pre>


{{define|package|The package name to search for.
{{define|short|The string produced will only contain the minor and major version}}
:Special characters in the package name will automatically be urlencoded. "*" and "?" can be used as wildcards.
{{define|v|The string produced will only contain the minor and major version prefixed with a v}}
:This argument is required, if you're not using it, use the "*" wildcard.}}
 
{{define|branch{{=}}|The branch of alpine to search (e.g. "3.19" or "edge"), defaults to "edge" if unset.}}
This template will only accept one parameter at a time, all parameters are optional.<br>
{{define|repo{{=}}|The repository to search (main, community, or testing). If unspecified all repositories will be searched.}}
If no parameters are supplied, or the parameters which are supplied are invalid, the full version string (minor.major.patchlevel) will be produced.
{{define|arch{{=}}|The architecture to search (x86_64, x86, aarch64, armhf, ppc64le, s390x, armv7, or risc64). Defaults to x86_64 if unset.
:Pass this parameter with no value (i.e. "arch{{=}}") to search all arches.}}
{{define|maintainer{{=}}|Search for packages with a certain maintainer. (e.g. "None" to search for unmaintained packages) If unspecified packages from all maintainers will be searched}}


=== Examples ===
=== Examples ===
Search for gtk+2.0 under the edge branch on the x86_64 architecture:
Display the full version string of the latest Alpine Linux stable:
<pre>{{Pkg|gtk+2.0}}</pre>
<pre>{{AlpineLatest}}</pre>
will produce:
will produce:
{{Pkg|gtk+2.0}}
{{AlpineLatest}}


Search for all gtk packages under the edge branch on the x86_64 architecture:
Display the short version string of the latest Alpine Linux stable:
<pre>{{Pkg|gtk*}}</pre>
<pre>{{AlpineLatest|short}}</pre>
will produce:
will produce:
{{Pkg|gtk*}}
{{AlpineLatest|short}}


Search for ALSA-related packages under the 3.19 branch on the x86 (i.e. i686) architecture:
Display the short version string of the latest Alpine Linux stable, prefixed with v:
<pre>{{Pkg|*alsa*|branch=v3.19|arch=x86}}</pre>
<pre>{{AlpineLatest|v}}</pre>
will produce:
will produce:
{{Pkg|*alsa*|branch=v3.19|arch=x86}}
{{AlpineLatest|v}}
 
</noinclude>
</noinclude><includeonly>{{#if:{{{1|}}} | <span class="plainlinks" style="font-family: monospace, Courier;font-size:10pt;">[https://pkgs.alpinelinux.org/packages?name={{urlencode:{{{1}}}}}&branch={{urlencode:{{ #if: {{{branch|}}} | {{{branch}}} | edge}}}}&repo={{urlencode:{{ #if: {{{repo|}}} | {{{repo}}}}}}}&arch={{urlencode:{{ #ifeq: {{{arch|+}}} | {{{arch|-}}} | {{{arch}}} | x86_64 }}}}&maintainer={{urlencode:{{ #if: {{{maintainer|}}} | {{{maintainer}}}}}}} {{{1}}}]</span> | <span class="error">First parameter cannot be undefined or empty in template: <b>Template:Pkg</b></span>}}</includeonly>
<!--If you're updating the string containing the latest version of Alpine, go to the top!-->

Latest revision as of 17:44, 6 September 2024

Template Documentation for Sandbox

This page is a template and should only 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.

This template produces a string containing the latest version of Alpine Linux

Usage

{{AlpineLatest|short|v}}

short
The string produced will only contain the minor and major version

v
The string produced will only contain the minor and major version prefixed with a v

This template will only accept one parameter at a time, all parameters are optional.
If no parameters are supplied, or the parameters which are supplied are invalid, the full version string (minor.major.patchlevel) will be produced.

Examples

Display the full version string of the latest Alpine Linux stable:

{{AlpineLatest}}

will produce: 3.20.3

Display the short version string of the latest Alpine Linux stable:

{{AlpineLatest|short}}

will produce: 3.20.3

Display the short version string of the latest Alpine Linux stable, prefixed with v:

{{AlpineLatest|v}}

will produce: 3.20.3