跳至內容

模板: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.