Template:Nixpkgs Manual: Difference between revisions

From NixOS Wiki
imported>Nix
create convenience template for linking to official Nixpkgs manual
 
m Change flavour of the example text
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Template}}
{{Template}}
This is the template which is used to easily link out to the official stable Nixpkgs Manual.
 
== About ==
Creates a link to the official stable Nixpkgs manual.


== Basic use ==
== Basic use ==
Line 10: Line 12:


== Advanced use ==
== Advanced use ==
=== Link to the unstable version ===
Example:
  <nowiki>{{Nixpkgs Manual|ver=unstable}}</nowiki>
Creates: {{Nixpkgs Manual|ver=unstable}}


=== Rename the link ===
=== Rename the link ===
Example:
Example:
   <nowiki>{{Nixpkgs Manual|name=Nixpkgs's Greatest Most OFFICIAL Manual}}</nowiki>
   <nowiki>{{Nixpkgs Manual|name=The official Nixpkgs manual}}</nowiki>


Creates: {{Nixpkgs Manual|name=Nixpkgs's Greatest Most OFFICIAL Manual}}
Creates: {{Nixpkgs Manual|name=The official Nixpkgs manual}}


=== Add an anchor link ===
=== Add an anchor link ===
Example:
Example:
   <nowiki>{{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Package Management|anchor=#sec-package-management}}</nowiki>
   <nowiki>{{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - The Standard Environment|anchor=#chap-stdenv}}</nowiki>


Creates: {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - The Standard Environment|anchor=#chap-stdenv}}
Creates: {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - The Standard Environment|anchor=#chap-stdenv}}


</noinclude>
</noinclude>
<includeonly>[https://nixos.org/manual/nixpkgs/stable/{{{anchor|}}} {{{name|Nixpkgs Manual}}}]</includeonly>
<includeonly>[https://nixos.org/manual/nixpkgs/{{{ver|stable}}}/{{{anchor|}}} {{{name|Nixpkgs Manual}}}]</includeonly>

Latest revision as of 01:28, 7 April 2024

This page is a template. It should be used as part of other articles. For more information, see 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 discuss this template in the talk page.

If you wanted to create a new page instead, use the search box to search for the title of the new page you want to create and follow the link Create the page "XYZ" on this wiki! in the results page. An alternative is to create a dangling link to the new page from an existing page. A final option is to directly visit the expected URL of the page.

About

Creates a link to the official stable Nixpkgs manual.

Basic use

Example:

 {{Nixpkgs Manual}}

Creates: Nixpkgs Manual

Advanced use

Link to the unstable version

Example:

 {{Nixpkgs Manual|ver=unstable}}

Creates: Nixpkgs Manual

Rename the link

Example:

 {{Nixpkgs Manual|name=The official Nixpkgs manual}}

Creates: The official Nixpkgs manual

Add an anchor link

Example:

 {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - The Standard Environment|anchor=#chap-stdenv}}

Creates: Nixpkgs Manual: Chapter - The Standard Environment