Cee*_*man 10

要创建 Info 文档,您首先需要一个 texi 文件。

.texi- Texinfo是一种排版语法,用于使用单个源文件生成在线和打印形式的文档(创建文件类型为 dvi、html、pdf 等,以及它自己的超文本格式、信息)。它由作为同名自由软件发布的计算机程序实现,由自由软件基金会的 GNU 项目创建并提供。

.info- 信息(通过makeinfo.生成)这是一种特定格式,它本质上是原始 Texinfo 语法的纯文本版本,并结合一些控制字符来分隔节点并为菜单、交叉引用、部分等提供导航元素. 信息格式可以用info程序查看。

makeinfo是一个将 Texinfo 文件转换为 Info 文件的实用程序;它是 texinfo 包的一部分texinfo-format-regiontexinfo-format-bufferGNU Emacs 函数也做同样的事情。

这是用作模板的 texi 示例

\input texinfo   @c -*-texinfo-*-
@comment $Id@w{$}
@comment %**start of header
@setfilename sample.info
@include version.texi
@settitle GNU Sample @value{VERSION}
@syncodeindex pg cp
@comment %**end of header
@copying
This manual is for GNU Sample (version @value{VERSION}, @value{UPDATED}),
which is an example in the Texinfo documentation.

Copyright @copyright{} 2013 Free Software Foundation, Inc.

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled
``GNU Free Documentation License''.
@end quotation
@end copying

@dircategory Texinfo documentation system
@direntry
* sample: (sample)Invoking sample.
@end direntry

@titlepage
@title GNU Sample
@subtitle for version @value{VERSION}, @value{UPDATED}
@author A.U. Thor (@email{bug-sample@@gnu.org})
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@contents

@ifnottex
@node Top
@top GNU Sample

This manual is for GNU Sample (version @value{VERSION}, @value{UPDATED}).
@end ifnottex

@menu
* Invoking sample::
* GNU Free Documentation License::
* Index::
@end menu


@node Invoking sample
@chapter Invoking sample

@pindex sample
@cindex invoking @command{sample}

This is a sample manual.  There is no sample program to
invoke, but if there were, you could see its basic usage
and command line options here.


@node GNU Free Documentation License
@appendix GNU Free Documentation License

@include fdl.texi


@node Index
@unnumbered Index

@printindex cp

@bye
Run Code Online (Sandbox Code Playgroud)

将其转换为 Info 文档

makeinfo mytool.texi
Run Code Online (Sandbox Code Playgroud)

列出新的信息文件

要将新的 Info 文件添加到您的系统,请dirinfo目录(/usr/share/info/在 Ubuntu 上)的文件的菜单中为其编写一个菜单条目。此外,将新的信息文件本身移动到info目录中。例如,如果您要为 GDB 添加文档,您将编写以下新条目:

* GDB: (gdb).           The source-level C debugger.
Run Code Online (Sandbox Code Playgroud)

菜单项的第一部分是菜单项名称,后跟一个冒号。第二部分是 Info 文件的名称,在括号中,后跟一个句点。第三部分是说明。

通常,信息文件的名称具有.info扩展名。因此,您可以像这样列出文件的名称:

* GDB: (gdb.info).           The source-level C debugger.
Run Code Online (Sandbox Code Playgroud)

但是,.info如果在菜单中给定的名称下找不到文件,Info 将查找具有扩展名的文件。这意味着您可以将文件gdb.info称为gdb,如第一个示例所示。这看起来更好。