1signature Help = sig 2(* Help -- on-line help functions *) 3 4val help : string -> unit 5 6val displayLines : int ref 7val helpdirs : string list ref 8val indexfiles : string list ref 9val specialfiles : {term : string, file : string, title : string} list ref 10val welcome : string vector ref 11val browser : (string -> unit) ref 12val defaultBrowser : string -> unit 13end; 14(* 15 [help s] provides on-line help on the topic indicated by string s. 16 17 help "lib"; gives an overview of the Moscow ML library. 18 help "id"; provides help on identifier id (case-insensitive). 19 20 If exactly one identifier in the library matches id (case-insensitive), 21 then the browser opens the signature defining that identifier, 22 positioning the first occurrence of id at the center of the screen. 23 24 If more than one identifier matches id (case-insensitive), then a 25 small menu lists the signatures containing the identifier. To 26 invoke the browser, just type in the number of the desired 27 signature. 28 29 The browser accepts the following commands, which must be followed 30 by a newline: 31 32 d move down by half a screen 33 u move up by half a screen 34 t move to top of file 35 b move to bottom of file 36 /str cyclically search for string str in help file (case-insensitive) 37 n search for next occurrence of str 38 q quit the browser 39 40 A newline by itself moves down one screen (24 lines). 41 42 [helpdirs] is a reference to a list of additional directories to be 43 searched for help files. The directories are searched in order, 44 after the -stdlib directory. 45 46 [indexfiles] is a reference to a list of full paths of help term 47 index files. Setting `indexfiles' affects subsequent invocations 48 of `help'. (Every invocation of `help' reads the index files anew). 49 50 [specialfiles] is a reference to a list of {term, file, title} 51 records, each of which maps a search term to the specified file 52 with the specified title (in the browser). The string in the 53 `term' field should be all lowercase, since the argument passed to 54 `help' will be converted to lowercase. 55 56 [welcome] is a reference to the text shown in response to the query 57 help "". This is a vector of lines of text. 58 59 [browser] is a reference to the function that gets invoked on the 60 text of the help file. Initially set to defaultBrowser. 61 62 [defaultBrowser] is the default (built-in) help browser. 63 64 [displayLines] is a reference to the size of the display (window) 65 assumed by the defaultBrowser; initially 24 lines. Set it to the 66 actual size of your window for best results. 67*) 68