Template:Man
此模板的文档不存在、不全面或不能详细描述其功能及/或其代码中的参数。请帮助扩充并改进其文档。 |
To be used for inserting 手册页 links into articles on Unix topics.
Usage
编辑Examples
编辑In Out {{man|3|printf}}
单一UNIX®规范第7期,由國際開放標準組織发布 – 参考,{{man|3|printf|||inline}}
{{man|3|printf|FreeBSD}}
FreeBSD库函数(Library Functions)手册页 –{{man|3|printf||formatted output conversion}}
单一UNIX®规范第7期,由國際開放標準組織发布 : formatted output conversion – 参考,
Parameters
编辑- Manual section
- Manual page name
- Source (the name of a subpage in the Template:Man 命名空间 e.g. FreeBSD. Leave blank for the current default.)
- Page description
- 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}}
单一UNIX®规范第7期,由國際開放標準組織发布 – 命令与工具(Commands & Utilities)参考,die.net {{man|1|ls|die.net}}
Linux用户命令(User Commands)手册页 –Version 7 Unix {{man|1|ls|v7}}
Version 7 Unix Programmer's Manual –4.2BSD {{man|1|ls|4.2BSD}}
Template:Man/4.2BSD –4.3BSD {{man|1|ls|4.3BSD}}
Template:Man/4.3BSD –4.3BSD-Reno {{man|1|ls|4.3BSD-Reno}}
Template:Man/4.3BSD-Reno –4.4BSD-Lite2 {{man|1|ls|4.4BSD-Lite2}}
BSD通用命令(General Commands)手册页 –Darwin {{man|1|ls|Darwin}}
Darwin和Mac OS X通用命令(General Commands)手册页 –Debian {{man|1|ls|Debian}}
Debian通用命令(General Commands)手册页 –man.cx {{man|8|iptables|man.cx|inline}}
DragonFly {{man|1|ls|DragonFly BSD}}
DragonFly通用命令(General Commands)手册页 –Fedora {{man|8|dnf|Fedora}}
Fedora维护命令(Maintenance Commands)手册页 –FreeBSD {{man|1|ls|FreeBSD}}
FreeBSD通用命令(General Commands)手册页 –HP-UX {{man|1|ls|HP-UX}}
HP-UX 11i用户命令(User Commands)手册页 –Inferno {{man|1|ls|Inferno}}
Inferno通用命令(General Commands)手册页 –IRIX {{man|1|ls|IRIX}}
IRIX 6.5用户命令(User Commands)手册页 –BIND 9 {{man|1|named|BIND 9}}
Template:Man/BIND 9 –Linux[2] {{man|7|epoll|Linux}}
Linux程序员手册页 – 概述、约定及杂项(Overview, Conventions and Miscellanea) –MirOS BSD {{man|1|ls|MirOS BSD}}
MirOS BSD i386通用命令(General Commands)手册页 –NetBSD {{man|1|ls|NetBSD}}
NetBSD通用命令(General Commands)手册页 –OpenBSD {{man|1|ls|OpenBSD}}
OpenBSD通用命令(General Commands)手册页 –OpenSolaris {{man|1|ls|OpenSolaris}}
Template:Man/OpenSolaris –perldoc[3] {{man|1|perlrun|perldoc}}
Template:Man/perldoc –Plan 9 {{man|1|ls|Plan 9}}
Plan 9通用命令(General Commands)手册页 –Solaris {{man|1|ls|Solaris}}
Solaris 10用户命令(User Commands)参考手册页 –SUS {{man|cu|ls|SUS}}
单一UNIX®规范第7期,由國際開放標準組織发布 – 命令与工具(Commands & Utilities)参考,SUS6 {{man|sh|putmsg|SUS6}}
Template:Man/SUS6 –
- ^ Redirects to the current default
- ^ 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.
- ^ 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}}
Sun Studio Developer's Manual : source-level debugging tool –
The interface of Template:man/format is therefore externally visible and needs to be kept constant.
Hacking
编辑Writing sources
编辑A source takes three parameters:
- Manual section
- Manual page name
- Output selector:
attrib
for attributionurl
for URL to pagedisplay_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.