Node:Menus, Next:, Previous:Add, Up:Expert Info



How to Create Menus

Any node in the Info hierarchy may have a menu--a list of subnodes. The m command searches the current node's menu for the topic which it reads from the terminal.

A menu begins with a line starting with * Menu:. The rest of the line is a comment. After the starting line, every line that begins with a * lists a single topic. The name of the topic-what the user must type at the m's command prompt to select this topic--comes right after the star and space, and is followed by a colon, spaces and tabs, and the name of the node which discusses that topic. The node name, like node names following Next, Previous and Up, may be terminated with a tab, comma, or newline; it may also be terminated with a period.

If the node name and topic name are the same, then rather than giving the name twice, the abbreviation * name:: may be used (and should be used, whenever possible, as it reduces the visual clutter in the menu).

It is considerate to choose the topic names so that they differ from each other very near the beginning--this allows the user to type short abbreviations. In a long menu, it is a good idea to capitalize the beginning of each item name which is the minimum acceptable abbreviation for it (a long menu is more than 5 or so entries).

The nodes listed in a node's menu are called its "subnodes", and it is their "superior". They should each have an Up: pointing at the superior. It is often useful to arrange all or most of the subnodes in a sequence of Next and Previous pointers so that someone who wants to see them all need not keep revisiting the Menu.

The Info Directory is simply the menu of the node (dir)Top--that is, node Top in file .../info/dir. You can put new entries in that menu just like any other menu. The Info Directory is not the same as the file directory called info. It happens that many of Info's files live in that file directory, but they do not have to; and files in that directory are not automatically listed in the Info Directory node.

Also, although the Info node graph is claimed to be a "hierarchy", in fact it can be any directed graph. Shared structures and pointer cycles are perfectly possible, and can be used if they are appropriate to the meaning to be expressed. There is no need for all the nodes in a file to form a connected structure. In fact, this file has two connected components. You are in one of them, which is under the node Top; the other contains the node Help which the h command goes to. In fact, since there is no garbage collector, nothing terrible happens if a substructure is not pointed to, but such a substructure is rather useless since nobody can ever find out that it exists.