home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff281.lzh / MRMan / mrman.man < prev    next >
Text File  |  1989-11-20  |  16KB  |  397 lines

  1.  
  2.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  3.  
  4.  
  5.  
  6.      ›1mNAME 
  7.  
  8.           ›0mMRMan - online manual reader 
  9.  
  10.      ›1mSYNOPSIS 
  11.  
  12.           MRMan›0m[-›1md ›0m<›1mdirectory›0m>] [-›1mv ›0m(›1mverbose›0m)] <›1msubject›0m>[...<›1msubject›0m>]
  13.  
  14.      ›1mDESCRIPTION 
  15.  
  16.           ›0mMRMan  is  a  highly configurable online document viewer for
  17.           the Amiga.    It  will  search  for   online   documentation
  18.           according  to a set of rules and present it to the user with
  19.           either the standard ›1mMore ›0mtext file viewer or  a  program  of
  20.           the user's choice.  
  21.  
  22.           One  of  the obvious problems with maintaining large amounts
  23.           of  online  documentation  is  the  additional  disk   space
  24.           required.  MRMan helps to alleviate this problem by allowing
  25.           document files to be compressed with an Amiga version of the
  26.           Un*x   ›1mcompress   ›0mprogram  which  is  available  through  PD
  27.           channels.  Supplied with  MRMan  is  a  special  version  of
  28.           ›1mcompress ›0mnamed  ›1mzcat›0m.    When  a compressed document file is
  29.           encountered, it is first  decompressed,  using  ›1mzcat›0m,  to  a
  30.           temporary file in the ›1mT›0m: directory.  
  31.  
  32.      ›1mDefault Document Lookup Rules 
  33.  
  34.           ›0mUnlike the Un*x environment, where most online documentation
  35.           is  written for a well-defined structure (nroff man pages in
  36.           /usr/man... directories), documentation on an  Amiga  system
  37.           is  likely  to  have  a wide variety of formats, origins and
  38.           naming conventions.  MRMan  attempts  to  accommodate  these
  39.           irregularities  with  a  flexible  set of rules for locating
  40.           documents.  
  41.  
  42.           Let's start with MRMan's default behavior.   MRMan  requires
  43.           at  least  two  setup  steps  in order to start functioning.
  44.           First,  copy  the  files  ›1mMRMan  ›0mand  ›1mzcat  ›0mto  one  of  the
  45.           directories   defined   by  your  AmigaDOS  PATH  (e.g.  C:,
  46.           SYS:Utilities, BIN:, etc.).    Next,  you  must  assign  the
  47.           logical  name  ›1mMAN›0m:  to  the  device or directory where your
  48.           online documentation is stored.    This  is  done  with  the
  49.           ›1mAssign ›0mcommand.  Here's an example: 
  50.  
  51.                Assign MAN: SYS:Documents 
  52.  
  53.           You  can  also  use  the  -›1md ›0mcommand line option to force an
  54.           initial document search point.  
  55.  
  56.           MRMan defaults to using the ›1mMore ›0mutility for viewing  files.
  57.           If  you  wish  to  override  this  default,  you  can set an
  58.           environment variable, ›1mManViewer ›0m, to  point  to  some  other
  59.           suitable  text  file  viewing  program  (or  editor,  if you
  60.           prefer).  Just be sure that the program you choose is in the
  61.           AmigaDOS command PATH. Example: 
  62.  
  63.  
  64.  
  65.      MRSoft                           -1-
  66.  
  67.  
  68.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  69.  
  70.  
  71.                setenv ManViewer TxView 
  72.  
  73.           The location chosen may  be  a  device  specification  (e.g.
  74.           df1:) or the name of a directory.  If this location contains
  75.           nested directories,  they  will also be searched.  Oh - just
  76.           one more  thing.    It  will  be  beneficial  to  have  some
  77.           documents online in the location you just chose :-). 
  78.  
  79.           When   attempting  to  locate  a  file  corresponding  to  a
  80.           particular subject, MRMan "filters out" filenames  which  do
  81.           not fit  a  set  of  patterns.   The simplest pattern is the
  82.           subject name itself.  That is, if a filename is found  which
  83.           exactly  matches  the  subject  (case  is unimportant), that
  84.           filename will be chosen.    Otherwise,  MRMan  looks  for  a
  85.           filename  which consists of the pattern ›3msubject.suffix ›0mwhere
  86.           ›3msuffix ›0mdefaults to one of the following: 
  87.  
  88.                man 
  89.                doc 
  90.                text 
  91.  
  92.           Note that the embedded period is not considered part of  the
  93.           suffix.   You  can  easily patch MRMan to change this set of
  94.           suffixes.  Read the section titled ›1mPatching MRMan  ›0mfor  more
  95.           info.  
  96.  
  97.           This  version of MRMan does not attempt to resolve conflicts
  98.           when two versions of the same subject  appear.    The  first
  99.           eligible candidate  is  always chosen.  For instance, if the
  100.           subject is ›3mMRMan ›0mand you have document  files  named  ›1mMRMan›0m,
  101.           ›1mMRMan›0m.›1mman  ›0mand  ›1mMRMan›0m.›1mdoc ›0min your ›1mMAN›0m: directory, there is a
  102.           conflict.  MRMan will accept any one of  these  as  a  valid
  103.           file.   The first eligible file encountered when MRMan scans
  104.           the ManPath will be selected.   Document  files  which  have
  105.           been compressed  will  normally  have  a  ".Z" suffix.  This
  106.           suffix is ignored when MRMan applies its  eligibility  test.
  107.           For example, ›1mMRMan›0m.›1mdoc›0m.›1mZ ›0mis actually seen as ›1mMRMan›0m.›1mdoc›0m. 
  108.  
  109.           When  determining  if  a  file is compressed, MRMan does not
  110.           rely on the filename extension.  Instead, it opens the  file
  111.           and  "takes a peek" at the "magic cookie" (1st two bytes) of
  112.           the document file.  Compressed files have a  constant  value
  113.           stored at these locations.  
  114.  
  115.  
  116.      ›1mExtended Document Lookup Rules 
  117.  
  118.           ›0mWhile  the  default  lookup rules may be adequate for simple
  119.           installations, something more is required  if  you  wish  to
  120.           maintain  disjoint  sets  of documentation or if you wish to
  121.           specify the order in which nested directories are  searched.
  122.           MRMan's extended  lookup  rules  to  the  rescue!  The first
  123.           extension to these  rules  is  the  use  of  an  environment
  124.           variable.    Environment   variables  were  introduced  with
  125.           AmigaDOS 1.3 and exist for the purpose  of  customizing  the
  126.           behavior of   adaptable   software.     You  can  define  an
  127.           environment variable named ›1mManPath  ›0mwhich  will  tell  MRMan
  128.           where,  and  in  which  order, to search for document files.
  129.  
  130.  
  131.      MRSoft                           -2-
  132.  
  133.  
  134.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  135.  
  136.  
  137.           This concept is very similar to the ›1mPATH  ›0mused  by  AmigaDOS
  138.           when it searches for a command file.  
  139.  
  140.           For example, I have two major sets of documentation residing
  141.           on my  system.    I wish, for housekeeping purposes, to keep
  142.           these documentation sets in disjoint directories.  That  is,
  143.           they do  not  fall  under the same directory hierarchy.  The
  144.           first document set resides under a logical name  "Doc:"  and
  145.           the  second  under  a  logical  name  "Docs1.3:".  The  MAN:
  146.           document   set   is   comprised   of   home-brew   and    PD
  147.           documentation.   The  "Docs1.3:"  document  set contains the
  148.           Commodore-Amiga "AutoDocs" for AmigaDOS 1.3. When  searching
  149.           for  a document, I would like to first search "Doc:", and if
  150.           the search fails there, proceed  to  search  "Docs1.3:".  To
  151.           establish  this  search  order,  I  first  set  the  ManPath
  152.           environment variable: 
  153.  
  154.                setenv ManPath "Doc:;Docs1.3:;" 
  155.  
  156.           Here is an example of the verbose (-v  option)  output  from
  157.           MRMan   when   searching   for  a  document  describing  the
  158.           "parallel" device: 
  159.  
  160.           MRMan: search path is 'Doc:;Docs1.3:;'.
  161.           Scanning directory 'Doc:'.
  162.           Scanning directory 'Doc:ARexx'.
  163.           Scanning directory 'Doc:Arp'.
  164.           Scanning directory 'Doc:JS'.
  165.           Scanning directory 'Doc:System'.
  166.           Scanning directory 'Doc:Graphics'.
  167.           Scanning directory 'Doc:WB'.
  168.           Scanning directory 'Doc:Games'.
  169.           Scanning directory 'Doc:Misc'.
  170.           Scanning directory 'Doc:Sound'.
  171.           Scanning directory 'Doc:Penny'.
  172.           Scanning directory 'Doc:Unix'.
  173.           Scanning directory 'Doc:Utilities'.
  174.           Scanning directory 'Docs1.3:'.
  175.           Scanning directory 'Docs1.3:Devices'.
  176.  
  177.           Notice that all directories in  the  "Doc:"  directory  were
  178.           scanned.   Then,  failing the search in "Doc:", MRMan picked
  179.           up the "Docs1.3:" directory name from the ManPath  variable.
  180.           The  document  "parallel.doc"  was  finally  located  in the
  181.           directory named "Docs1.3:Devices". For the curious, it  took
  182.           about 4  seconds to locate and present the file.  There were
  183.           207 files in the "Doc:" hierarchy.  
  184.  
  185.           When setting up your ManPath, it is wise to make a few trial
  186.           runs with the verbose  option  (-v).  Attempt  to  locate  a
  187.           document that  you  know  doesn't  exist.    The output will
  188.           assist you in making refinements in  your  ManPath.  In  the
  189.           example  above,  two  directories,  "Doc:JS" and "Doc:Penny"
  190.           contain files that  are  not  really  online  documentation.
  191.           "How do I  do  dat?",  you  ask.    "Easy",  I  answer.  The
  192.           device/directory names specified in the ManPath  environment
  193.           variable are considered to be "top-level" directories, which
  194.           MRMan  treats  specially  (regardless of where they actually
  195.  
  196.  
  197.      MRSoft                           -3-
  198.  
  199.  
  200.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  201.  
  202.  
  203.           reside in  your  overall  filesystem).    If  a  file  named
  204.           "ManPath"  (where  have you heard that name before?) appears
  205.           in one of these  top-level  directories,  its  contents  are
  206.           expected to contain another search path.  The format of this
  207.           file  is  the  same as for the ManPath environment variable.
  208.           Directory names are separated  by  semicolons  or  newlines.
  209.           Here's an  additional feature.  If an element of the ManPath
  210.           file  contains  a  logical  name  or  device   specification
  211.           (embedded  colon),  that element will be used as an absolute
  212.           pathname specification.  If the element does not  contain  a
  213.           logical  name  or  device specification, it is assumed to be
  214.           relative to the directory where the ManPath file was  found.
  215.           This  may  sound  a  little  confusing,  so let's look at an
  216.           example.  Remember that our ManPath environment variable  is
  217.           set  to  "Doc:;Docs1.3:".  To eliminate the directories "JS"
  218.           and "Penny" from the "Doc:"  search,  I  construct  a  file,
  219.           named "Doc:ManPath", which looks like this: 
  220.  
  221.           Doc:Unix
  222.           Utilities
  223.           System
  224.           Misc
  225.           ARexx
  226.           Arp
  227.           Graphics
  228.           WB
  229.           Games
  230.           Sound
  231.  
  232.           Note  that  the  first line is a full pathname ("Doc:Unix").
  233.           This is purely for illustration.  The other directory  names
  234.           have  an ›3mimplied ›0mprefix of "Doc:" by nature of the fact that
  235.           they are relative to the directory where the ManPath 
  236.  
  237.           file was found ("Doc:"). Also interesting to  note  is  that
  238.           the  order  of  the  directory  names  is different from the
  239.           original scan.  The original scan  retrieved  ALL  directory
  240.           names  in  the  order  that  the  Amiga filesystem presented
  241.           them.  By using a ManPath file, you can optimize this  order
  242.           to search most frequently accessed directories first.  
  243.  
  244.  
  245.      ›1mPatching MRMan 
  246.  
  247.           ›0mTaking  adaptability to the extreme, MRMan has been designed
  248.           so that you can easily  change  the  embedded  names  (MAN:,
  249.           ManPath, etc.)  in  the  MRMan  executable.   In order to do
  250.           this, you must have a binary file editor, such  as  FileZap.
  251.           Each  item  which  you  can  change has a descriptive string
  252.           preceding it.  You'll have to scan the  executable  to  find
  253.           the "patch area", but it should not be difficult.  The patch
  254.           area is  near  the  end  of the file.  Search for the string
  255.           "->" and you'll probably find it on the first try.  
  256.  
  257.           Each of the patchable entities has the following format: 
  258.  
  259.           # Descriptive text (max length) -> <null> Item text 
  260.  
  261.  
  262.  
  263.      MRSoft                           -4-
  264.  
  265.  
  266.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  267.  
  268.  
  269.           The ›3mDescriptive text ›0mwill help you identify  the  nature  of
  270.           the item.  The ›3m(max length) ›0mfield defines the maximum number
  271.           of  characters  (less  terminating null) that you may enter.
  272.           There MUST  be  a  null  byte  immediately  after  the  "->"
  273.           (pointer) and after the ›3mItem text.  
  274.  
  275.           ›0mThe items you can change are: 
  276.  
  277.           # Temp file name for compressed files (32) -> T:MRManXXXXXX 
  278.  
  279.           Compressed  files are first decompressed to a temporary file
  280.           by ›1mzcat   ›0mprior   to   viewing.      Depending   upon   your
  281.           configuration,  you  might  want to change this to something
  282.           like  "RAM:MRManXXXXXX".  The  XXXXXX  pattern  must   exist
  283.           somewhere  in  the specification as this is where the unique
  284.           portion of the filename (multiple MRMan's  [MRMen?]  may  be
  285.           run simultaneously) is stored.  
  286.  
  287.           # Environment device name (32) -> ENV: 
  288.  
  289.           Environment  variables  are treated very similarly to files.
  290.           If you would rather use some  other  logical  name  for  the
  291.           ManPath  environment  variable  (and  give up using setenv),
  292.           it's your choice.  
  293.  
  294.           # Search path variable name (32) -> ManPath 
  295.  
  296.           If the ManPath  environment  variable  name  conflicts  with
  297.           another  definition  already present in your system, you can
  298.           choose another name here.  
  299.  
  300.           # Man directory logical name (32) -> MAN: 
  301.  
  302.           If you already  have  a  preferred  logical  name  for  your
  303.           document hierarchy, you can override MRMan's default here.  
  304.  
  305.           # Man search path filename (32) -> ManPath 
  306.  
  307.           You  are  free to name your top-level ManPath file something
  308.           else.  
  309.  
  310.           # Default viewer program name (32) -> More 
  311.  
  312.           If  you  have  a  text  viewer  that  you  prefer  over  the
  313.           "standard" More  utility,  plug  its  name in here.  Just be
  314.           sure that it's in the AmigaDOS command PATH.  
  315.  
  316.           # Suffix 1 (8) -> man 
  317.  
  318.           # Suffix 2 (8) -> doc 
  319.  
  320.           # Suffix 3 (8) -> text 
  321.  
  322.           These are the filename suffixes that MRMan will accept  when
  323.           searching for a  document  file.   Do you need more?  Should
  324.           they be longer?  Please let me know!  
  325.  
  326.           I'd  appreciate  feedback  on  this  approach   to   program
  327.  
  328.  
  329.      MRSoft                           -5-
  330.  
  331.  
  332.      MRMAN(1)              AM*GA Programmer's Manual               MRMAN(1)
  333.  
  334.  
  335.           adaptability.   Many of you probably had your first taste of
  336.           it when you modified the 1.2 Execute  command  to  reference
  337.           "T:"  rather  than ":T". Since this program is released with
  338.           source,  this  feature  is  obviously   intended   for   the
  339.           non-programmer   (who   probably   doesn't  keep  a  lot  of
  340.           documentation online :-).  Was it worth the extra effort?  
  341.  
  342.  
  343.      ›1mAUTHOR 
  344.                     ›0mMark R. Rinfret
  345.                     348 Indian Avenue
  346.                     Portsmouth, RI 02871
  347.                     (401) 846-7639 (home)
  348.                     (401) 849-9390 (work)
  349.  
  350.                     Usenet: mrr\amanpt1.Newport.RI.US
  351.                     BIX:    markr
  352.                     CIS:    72017, 136
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.      MRSoft                           -6-
  396.  
  397.