Next: , Up: Menus   [Contents][Index]


4.9.1 Writing a Menu

A menu consists of a @menu command on a line by itself, followed by menu entry lines or menu comment lines, and then followed by an @end menu command on a line by itself.

A menu looks like this:

@menu
Larger Units of Text

* Files::                       All about handling files.
* Multiples: Buffers.           Multiple buffers; editing
                                 several files at once.
@end menu

In a menu, every line that begins with an ‘ is a menu entry. (Note the space after the asterisk.)

A line that does not start with an ‘ may also appear in a menu. Such a line is not a menu entry but rather a menu comment line that appears in the Info file. In the example above, the line ‘Larger Units of Text’ is such a menu comment line; the two lines starting with ‘ are menu entries.

Technically, menus can carry you to any node, regardless of the structure of the document; even to nodes in a different Info file. However, we do not recommend making use of this, because it is hard for readers to follow. Also, the makeinfo implicit pointer creation feature (see makeinfo Pointer Creation) and GNU Emacs Texinfo mode updating commands work only to create menus of subordinate nodes in a hierarchically structured document. It is much better to use cross-references to refer to arbitrary nodes.

makeinfo can automatically generate menus in nodes for Info and HTML output, based on the chapter structure of the document. To specify that you want it to do this, place the line ‘@validatemenus off’ near the beginning of the document.

In Info, a user selects a node with the m (Info-menu) command. The menu entry name is what the user types after the m command. In the HTML output from makeinfo, the accesskey attribute is used with the values ‘1’…‘9’ for the first nine entries. This allows people using web browsers to follow the first menu entries using (typically) M-digit, e.g., M-1 for the first entry.


Next: , Up: Menus   [Contents][Index]