如果这是不可能的,处理从UTF-8编码的POD派生的手册页的最佳做法是什么?
要在POD中使用Unicode,要做的第一件事就是使用该指令
=encoding UTF-8
Run Code Online (Sandbox Code Playgroud)
(如所讨论此处).该pod2text和pod2html工具将正常工作,并产生完美的UTF-8编码输出.
pod2man但是,该工具不会:
pod2man -u MyModule.pm | nroff -Tutf8 -man | less
Run Code Online (Sandbox Code Playgroud)
也没有perldoc.非ASCII字符都被破坏或X-ed输出.关于perlbug是否可能是一个错误或**roff*,有一些不确定的讨论pod2man.
由于我的模块专门处理Unicode并且打算在CPAN上进行分发,因此必须使用支持Unicode的手册页.
我使用的是Perl 5.14.2,perldoc 3.15和*roff 1.21.
我维护一个自定义编译的Python安装/opt/python-2.7.6.我希望安装手册页share/man.我已经安装了已经使用几个库pip(numpy,scipy,matplotlib,sympy).我不确定他们是否应该附带手册页.
现在,我安装了pygments.它附带一个名为的二进制文件pygmentize,它已正确安装bin.
Sidetracking:我在Debian包中查找了文件python-pygments,它附带了一个手册页:
$ apt-file list python-pygments
...
/usr/share/man/man1/pygmentize.1.gz
...
Run Code Online (Sandbox Code Playgroud)
回到主题:我不想安装python-pygments,apt-get因为它将与系统Python相关联.我想继续使用pip来维护我的自定义Python安装.使用将share/man目录添加到MANPATH环境变量应该很容易.bashrc
export MANPATH=/opt/python-2.7.6/share/man:$MANPATH
Run Code Online (Sandbox Code Playgroud)
问题:如何使用pip与Python库一起安装手册页?
可能重复:
为什么类Unix环境中的程序在其名称后面有数字?
(1)是什么意思?
创作手册页的最佳方法是什么?我应该使用标准的man宏编写,还是现在有一些聪明的包可以使用某种XML-ified源并且可以输出手册页,HTML,ASCII,什么不是?
谢谢
是否有任何体面的GUI(图形用户界面)WYSIWYG(所见即所得)编辑器(在任何平台上)可用于创作/编辑联机帮助页?可以导出为troff格式的应用程序也没问题.
我正在寻找一种通过API查询linux手册页的方法,我发现最接近的是http://linux.die.net/man,但是命令分为8个部分,例如gcc是第1部分:http://linux.die.net/man/1/gcc,因为它实际上不是一个API,所以你得到一个完整的html页面(包括侧边栏和广告)作为回报.
在我开始尝试制作之前,这样的事情是否已经存在?
snprintf(3)的Linux手册页给出了以下示例:
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
char *
make_message(const char *fmt, ...)
{
int n;
int size = 100; /* Guess we need no more than 100 bytes */
char *p, *np;
va_list ap;
if ((p = malloc(size)) == NULL)
return NULL;
while (1) {
/* Try to print in the allocated space */
va_start(ap, fmt);
n = vsnprintf(p, size, fmt, ap);
va_end(ap);
/* Check error code */
if (n < 0)
return NULL;
/* If that worked, return …Run Code Online (Sandbox Code Playgroud) 例如,取open(2),其中包含以下概要:
Run Code Online (Sandbox Code Playgroud)#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); int creat(const char *pathname, mode_t mode);
我应该包括所有这些头文件还是其中任何一个?在前一种情况下,我如何知道哪些头文件包含哪些函数,宏和typedef?
我经常使用Guake终端模拟器.这是切片育成IMO以来最好的事情.
但有一件事一直困扰着我,当我想阅读手册页时,输出的默认宽度是终端窗口的宽度,在我的情况下总是全屏,所以它有点难以阅读.
有没有办法让man命令输出的默认宽度为a,阅读愉快,80个字符?
man的手册页有这一部分:
Run Code Online (Sandbox Code Playgroud)MANWIDTH If $MANWIDTH is set, its value is used as the line length for which manual pages should be formatted. If it is not set, manual pages will be formatted with a line length appropriate to the current terminal (using an ioctl(2) if available, the value of $COLUMNS, or falling back to 80 characters if neither is available). Cat pages will only be saved when the default formatting can be used, that is when the terminal …
我正在编写一些自定义man页面,我希望包含可能经常更改的内容,例如man页面编写的日期.
例如,一个是在git 回购中,我想更新man页面的日期,无需手动更改.
是否有可能#include在*roff文件中调用shell变量,或者可能是markdown文件,然后使用pandoc" 编译 " man页面?
我知道这是一个奇怪的问题,但我没有遇到过类似的问题.
请注意,这与简单地包含$MANPATH要调用的手册页不同man.
IE,我想使用类似的东西:
.TH foo 10 "$(git log -n1 | grep Date | tail -c 31)" "$(git branch | grep "*")"
而不是每次都必须手动更改日期和分支/头名称.无论是降价还是给予pandoc或其他内容,还是roff文件本身,我都可以.