Template:Man

From blackwiki
Revision as of 21:40, 1 January 2007 by imported>EdC~enwiki
Jump to navigation Jump to search

{{{2}}}({{{1}}}): {{{4}}} – {{{5}}}

To be used for inserting manual page links into articles on Unix topics.

Usage

Examples

In Out
{{man|3|printf}} printf(3): {{{4}}} – {{{5}}}
{{man|3|printf|||inline}} printf(3) – inline
{{man|3|printf|FreeBSD}} printf(3): {{{4}}} – {{{5}}}
{{man|3|printf||formatted output conversion}} printf(3): formatted output conversion – {{{5}}}

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 Result
default[1] {{man|1|ls}} ls(1): {{{4}}} – {{{5}}}
die.net {{man|1|ls|die.net}} ls(1): {{{4}}} – {{{5}}}
Version 6 Unix {{man|1|ls|v6}} ls(1): {{{4}}} – {{{5}}}
Version 7 Unix {{man|1|ls|v7}} ls(1): {{{4}}} – {{{5}}}
4.2BSD {{man|1|ls|4.2BSD}} ls(1): {{{4}}} – {{{5}}}
4.3BSD {{man|1|ls|4.3BSD}} ls(1): {{{4}}} – {{{5}}}
4.3BSD-Reno {{man|1|ls|4.3BSD-Reno}} ls(1): {{{4}}} – {{{5}}}
4.4BSD-Lite2 {{man|1|ls|4.4BSD-Lite2}} ls(1): {{{4}}} – {{{5}}}
9front {{man|1|ls|9front}} ls(1): {{{4}}} – {{{5}}}
Darwin {{man|1|ls|Darwin}} ls(1): {{{4}}} – {{{5}}}
Debian {{man|1|ls|Debian}} ls(1): {{{4}}} – {{{5}}}
man.cx {{man|8|iptables|man.cx|inline}} iptables(8) – inline
DragonFly BSD {{man|1|ls|DragonFly BSD}} ls(1): {{{4}}} – {{{5}}}
FreeBSD {{man|1|ls|FreeBSD}} ls(1): {{{4}}} – {{{5}}}
HP-UX {{man|1|ls|HP-UX}} ls(1): {{{4}}} – {{{5}}}
Inferno {{man|1|ls|Inferno}} ls(1): {{{4}}} – {{{5}}}
IRIX {{man|1|ls|IRIX}} ls(1): {{{4}}} – {{{5}}}
BIND 9 {{man|1|named|BIND 9}} named(1): {{{4}}} – {{{5}}}
Linux[2] {{man|7|epoll|Linux}} epoll(7): {{{4}}} – {{{5}}}
ManKier[2] {{man|1|ls|ManKier}} ls(1): {{{4}}} – {{{5}}}
MirOS BSD {{man|1|ls|MirOS BSD}} ls(1): {{{4}}} – {{{5}}}
NetBSD {{man|1|ls|NetBSD}} ls(1): {{{4}}} – {{{5}}}
OpenBSD {{man|1|ls|OpenBSD}} ls(1): {{{4}}} – {{{5}}}
OpenSolaris {{man|1|ls|OpenSolaris}} ls(1): {{{4}}} – {{{5}}}
perldoc[3] {{man|1|perlrun|perldoc}} perlrun(1): {{{4}}} – {{{5}}}
Plan 9 {{man|1|ls|Plan 9}} ls(1): {{{4}}} – {{{5}}}
Solaris {{man|1|ls|Solaris}} ls(1): {{{4}}} – {{{5}}}
SUS[4] {{man|cu|ls|SUS}} [

https://www.opengroup.org/onlinepubs/9699919799/utilities/ls.html

ls(cu)]: {{{4}}} – {{{5}}}
SUS6[4] {{man|sh|putmsg|SUS6}} [

https://www.opengroup.org/onlinepubs/009695399/functions/putmsg.html

putmsg(sh)]: {{{4}}} – {{{5}}}
  1. Redirects to the current default
  2. 2.0 2.1 Note: this covers all sections, including section 1 of the Linux user's manual and sections 2, 3, 4, 5, 6, 7, and 8 of the Linux programmer's manual.
  3. Note: this is the official documentation included with Perl. It does not contain general manual pages.
  4. 4.0 4.1 Note: the SUS pages use a non-numerical chapter system. A simple mapping is in place for human comfort.

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/die.net. Template:man/format actually formats the link and descriptions into a nice-looking link+auxilia in Unix style.