Template:Man/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Script error: No such module "Message box". To be used for inserting manual page links into articles on Unix topics.

Usage

Examples

In Out
{{man|3|printf}} printf – System Interfaces Reference, The Single UNIX Specification, Version 5 from The Open Group
{{man|3|printf|||inline}} printf
{{man|3|printf|FreeBSD}} printf(3) – FreeBSD Library Functions Manual
{{man|3|printf||formatted output conversion}} printf: formatted output conversion – System Interfaces Reference, The Single UNIX Specification, Version 5 from The Open Group

Parameters

  1. Manual section
  2. Manual page name
  3. Source (the name of a subpage in the Template:Man namespace e.g. FreeBSD. Leave blank for the current default.)
  4. Page description
  5. Style parameter; currently inline omits the attribution.

Available sources

Please add to this table as you write new sources!

Source Example Template:Right arrow Result
defaultTemplate:Efn Template:Tlx
die.net Template:Tlx
Version 6 Unix Template:Tlx
Version 7 Unix Template:Tlx
Version 8 Unix Template:Tlx
4.2BSD Template:Tlx
4.3BSD Template:Tlx
4.3BSD-Reno Template:Tlx
4.4BSD-Lite2 Template:Tlx
9front Template:Tlx
Darwin Template:Tlx
Debian Template:Tlx
man.cx Template:Tlx
DragonFly BSD Template:Tlx
FreeBSD Template:Tlx
HP-UX Template:Tlx
Inferno Template:Tlx
IRIX Template:Tlx
LinuxTemplate:Efn Template:Tlx
ManKierTemplate:Efn Template:Tlx
MirOS BSD Template:Tlx
NetBSD Template:Tlx
OpenBSD Template:Tlx
OpenSolaris Template:Tlx
perldocTemplate:Efn Template:Tlx
Plan 9 Template:Tlx
Solaris Template:Tlx
SUSTemplate:Efn Template:Tlx
SUS6Template:Efn Template:Tlx

Template:Notelist

General recommendations

For most articles, it is preferable to cite SUS (if present) for standard, the FreeBSD page for history, and the Linux page for a relatively widespread form. Add other OS pages as needed.

There are several sources for Linux manual pages. Just use "Linux" which points to manned.org, which has up-to-date manpages collected from several Linux distributions (as well as FreeBSD); it will, by default, "try to get the latest and most-close-to-upstream version of a man page", which "will fetch the man page from any of the available systems".[1] Do not go for die.net unless it's the only place where a page can be found, as the formatting is horrible and the pages are old.

Other sources

Occasionally you will come across manual pages for which writing a source is overkill. In this case you can use Template:man/format directly with a URL for formatting:

In Out
{{man/format|1|dbx|http://.../dbx.1.html|source-level debugging tool|[[Sun Studio]] Developer's Manual}}
dbx(1): source-level debugging tool – Sun Studio Developer's Manual

The interface of Template:man/format is therefore externally visible and needs to be kept constant.

Hacking

Writing sources

A source takes three parameters:

  1. Manual section
  2. Manual page name
  3. Output selector:
    • attrib for attribution
    • url for URL to page
    • display_section for section to display in parentheses.

See Template:Man/die.net for an example; see Template:Man/FreeBSD for a demonstration of varying the attribution by manual section.

Internals

Template:man handles choosing the default source and calling it for URL and attribution; the default source is Template:man/default, which is a template redirect currently to Template:man/SUS. Template:man/format actually formats the link and descriptions into a nice-looking link+auxilia in Unix style.

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".