跳转到内容

Template:Man/doc

维基百科,自由的百科全书

To be used for inserting 手册页 links into articles on Unix topics.

Usage

Examples

In Out
{{man|3|printf}} printf – 参考,单一UNIX®规范第7期,由國際開放標準組織发布
{{man|3|printf|||inline}} printf
{{man|3|printf|FreeBSD}} printf(3) – FreeBSD库函数(Library Functions)手册页
{{man|3|printf||formatted output conversion}} printf: formatted output conversion – 参考,单一UNIX®规范第7期,由國際開放標準組織发布

Parameters

  1. Manual section
  2. Manual page name
  3. Source (the name of a subpage in the Template:Man 命名空间 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|cu|ls}} ls – 命令与工具(Commands & Utilities)参考,单一UNIX®规范第7期,由國際開放標準組織发布
die.net {{man|1|ls|die.net}} ls(1) – Linux用户命令(User Commands)手册页
Version 7 Unix {{man|1|ls|v7}} ls(1) – Version 7 Unix Programmer's Manual
4.2BSD {{man|1|ls|4.2BSD}} [[[:Template:Man/4.2BSD]] ls(Template:Man/4.2BSD)] – Template:Man/4.2BSD
4.3BSD {{man|1|ls|4.3BSD}} [[[:Template:Man/4.3BSD]] ls(Template:Man/4.3BSD)] – Template:Man/4.3BSD
4.3BSD-Reno {{man|1|ls|4.3BSD-Reno}} [[[:Template:Man/4.3BSD-Reno]] ls(Template:Man/4.3BSD-Reno)] – Template:Man/4.3BSD-Reno
4.4BSD-Lite2 {{man|1|ls|4.4BSD-Lite2}} ls(1) – BSD通用命令(General Commands)手册页
Darwin {{man|1|ls|Darwin}} ls(1) – DarwinMac OS X通用命令(General Commands)手册页
Debian {{man|1|ls|Debian}} ls(1) – Debian通用命令(General Commands)手册页
man.cx {{man|8|iptables|man.cx|inline}} [[[:Template:Man/man.cx]] iptables(Template:Man/man.cx)]
DragonFly {{man|1|ls|DragonFly BSD}} ls(1) – DragonFly通用命令(General Commands)手册页
Fedora {{man|8|dnf|Fedora}} dnf(8) – Fedora维护命令(Maintenance Commands)手册页
FreeBSD {{man|1|ls|FreeBSD}} ls(1) – FreeBSD通用命令(General Commands)手册页
HP-UX {{man|1|ls|HP-UX}} ls(1) – HP-UX 11i用户命令(User Commands)手册页
Inferno {{man|1|ls|Inferno}} ls(1) – Inferno通用命令(General Commands)手册页
IRIX {{man|1|ls|IRIX}} ls(1) – IRIX 6.5用户命令(User Commands)手册页
BIND 9 {{man|1|named|BIND 9}} [[[:Template:Man/BIND 9]] named(Template:Man/BIND 9)] – Template:Man/BIND 9
Linux[2] {{man|7|epoll|Linux}} epoll(7) – Linux程序员手册页 – 概述、约定及杂项(Overview, Conventions and Miscellanea)
MirOS BSD {{man|1|ls|MirOS BSD}} ls(1) – MirOS BSD i386通用命令(General Commands)手册页
NetBSD {{man|1|ls|NetBSD}} ls(1) – NetBSD通用命令(General Commands)手册页
OpenBSD {{man|1|ls|OpenBSD}} ls(1) – OpenBSD通用命令(General Commands)手册页
OpenSolaris {{man|1|ls|OpenSolaris}} [[[:Template:Man/OpenSolaris]] ls(Template:Man/OpenSolaris)] – Template:Man/OpenSolaris
perldoc[3] {{man|1|perlrun|perldoc}} [[[:Template:Man/perldoc]] perlrun(Template:Man/perldoc)] – Template:Man/perldoc
Plan 9 {{man|1|ls|Plan 9}} ls(1) – Plan 9通用命令(General Commands)手册页
Solaris {{man|1|ls|Solaris}} ls(1) – Solaris 10用户命令(User Commands)参考手册页
SUS {{man|cu|ls|SUS}} ls – 命令与工具(Commands & Utilities)参考,单一UNIX®规范第7期,由國際開放標準組織发布
SUS6 {{man|sh|putmsg|SUS6}} [[[:Template:Man/SUS6]] putmsg(Template:Man/SUS6)] – Template:Man/SUS6
  1. ^ Redirects to the current default
  2. ^ Note: this is the Linux programmer's manual. It contains manual pages primarily from sections 2, 3, 4, 5 and 7, and does not cover the usual user utilities.
  3. ^ Note: this is the official documentation included with Perl. It does not contain general manual pages.

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.