MENU Copyright 1992 Ronald Florence Every computer has menues. This menu is for food. Menu and the companion program nr (mnemonic for new recipe) maintain and search an index and database of recipes -- from the rec.food newsgroups, email, cookbooks, or notebooks. No special recipe format is required. Menu displays and/or prints on-line recipes, and gives page references for recipes in cookbooks or notebooks. Searches can use multiple keywords or regular expressions; case and word order are not significant. menu chicken 'garlic|lemon' --> recipes with chicken AND either garlic or lemon menu venison chili --> recipes for venison chili menu 'blond|brown' --> brownies or blondies menu '^comp' prune --> on-line recipes with prunes menu '^Julia' --> Julia [Child] recipes There are two versions of menu. The X-windows version uses the mouse to select on-line recipes for display in separate windows. The termcap-based version, for Unix or ms-dos systems, displays one on-line recipe at a time. Both versions include commands for printing a recipe. SOURCE CODE The source code for menu and nr is in Icon. If your system does not have the Icon programming language, it is available for Unix, ms-dos, and many other operating systems from the icon-project@cs.arizona.edu. The code for menu uses procedures from the IPL (Icon Program Library) distributed with Icon: the termcap version uses iolib.icn, and the ms-dos version also uses either regexp.icn or findre.icn. The X-windows version of menu requires evmux.icn and button.icn, which are distributed with the Icon source code. CONFIGURATION For Unix systems, all configuration can be done by setting the following variables at the top of the Makefile: Indexfile = the full path of the recipe index Datadir = the full path of the recipe directory, terminated with `/'. Printcmd = a command to pretty-print and/or spool an ascii file. The name of the recipe will be substituted for a %s in the string. Not used for ms-dos. Compress = Optional, to store the recipes compressed. Not used for ms-dos. Mansuffix = the suffix for local man pages on your system. For X-windows sites, set the following: Maxwin = maximum number of lines on the windows. Font = display font. For non-X-Windows Unix, you can optionally set: Pager = an optional external pager such as more or less, used instead of the built-in pager. For ms-dos systems, the files have to be configured manually: Rename menu.S to menu.icn and nr.S to nr.icn. Use an editor to substitute the full path of your recipe index for %INDEXFILE% and the full path of your recipe directory for %DATADIR% in menu.icn, nr.icn, and menu.man. Use `\\' as the path separator and the terminator of the recipe directory path. Change the link list in menu.icn and the menu.icx entry of the Makefile to include regexp findre. If you use regexp, edit menu.icn so regexparser := ReFind; with findre, regexparser := findre. Create the recipe directory. Make sure you have a dos termcap file in place and the TERM and TERMCAP environment variables set (if you are not familiar with termcap, see the comments to iolib.icn). Many of the configuration parameters can be overridden in the Xresource files for X-Windows, or with environment variables. See the man page for details. INSTALLATION After configuring the Makefile, do `make X' for the X-Windows version or `make unix' for the termcap version. For ms-dos, you can do `make dos' or icont menu iolib regexp [or findre] icont nr Install menu by copying the executables (menu and nr for unix, menu.icx and nr.icx for ms-dos) to the appropriate local binary directory, and the man page to the appropriate man directory. See below for adding recipes. To try the program, do `make test.' ADDING RECIPES Nr is a simple filter which saves and automatically indexes recipes from newsgroups, electronic mail, or a scanner. From a mail- or news-reader use the pipe command on the current article: | nr "recipe name" "ingredients" With a typed-in or scanned recipe: nr "recipe-name" "ingredients" < recipe-file You can customize nr to eliminate additional headers by editing the noshow list in the code. To add recipes from cookbooks, or recipes pasted into notebooks, use an editor to append an entry like one of the following to your recipe index. The first field is the name of the book and a page-number. The second field is the name of the recipe. The third field is keywords or ingredients. Use tabs to separate the three fields: Julia I-496 Red Cabbage & Sauerkraut bacon, apples Julia I-300 Bifteck Hache ground venison, wine, thyme, hamburger Julia Way-340 Hominy Grits butter, milk, cheese, eggs, cream Julia Way-70 Timbales corn, ham, asparagus, broccoli, eggs Red-1 Skillet Corn Bread cornmeal Red-1 Viennese Crescents Gisa, Christmas, almonds Red-1 Indian Pudding corn meal, molasses, ginger Red-1 Hickory Nut Cake hickory nuts, egg whites Red-2 Norwegian Pancakes buttermilk, berries You can use commas in the third field; they are not necessary. The first field for on-line recipes is Comp-#, where # is the file name of the recipe. These recipes are entered automatically by nr, which keeps track of the file numbers. The recipe index does not need to be sorted. PERFORMANCE The Unix versions of menu use egrep. Searches with complex regular expressions take less than one second with a 2000-item index on a Sun3. The ms-dos version is slower because it relies on regular expression parsers written in Icon. Putting any regular expression last in the search command may speed things up somewhat. DISCLAIMER Permission is hereby granted for unlimited non-commercial use of these programs, on condition that the copyright notices are left intact and any modifications to the source code are noted as such. No warranty of any kind is implied or granted for this material. Ronald Florence ron@mlfarm.com @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)