home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / text / htext.lzh / hypertext / Documentation / LinkCommands < prev    next >
Encoding:
Text File  |  1990-12-24  |  15.5 KB  |  372 lines

  1. \help ht.help
  2. \fgcolor 2
  3. \bgcolor 3
  4. \title Link Commands - Descriptions and Examples
  5. \bold \\LINK { <somefilename> [somephrase] } \bold
  6.  
  7. \format
  8.      This command is the \ital hypertext \ital part of the whole program.
  9. It is \bold THE \bold '\\' command.  It creates a link between
  10. <somefilename> and the text after the closing '}', until the \\endlink
  11. command. If [somephrase] is given, then that will be searched for in
  12. <somefilename> and put at the top line of the new window.  This is what
  13. hypertext is about.
  14.  
  15.       The first word inside of the curly braces ({}'s) is considered to
  16. be the filename you are linking to.  Anything after the first word is
  17. considered to be the phrase/word you want to link to in the new file.
  18. This means that if you were to specify \\link { words.txt this is a
  19. sentence. }, then HT would open the file words.txt, read it in, search for
  20. "this is a sentence." and display the line that contains it at the top of
  21. the new window.  If "this is a sentence" cannot be found, HT will just
  22. display the file as normal, with the first line of the file at the top of
  23. the window.  \ital NOTE: \ital You cannot currently have spaces in the name
  24. of the file you are linking to.
  25.  
  26.      You can link to a word, phrase, or sentence in any file anywhere
  27. provided you give the file a full path name.  That file doesn't even
  28. \ital have \ital to be a HT document (it would be nice though).  The
  29. phrase/word you are looking for in <somefilename> must be less than 2048
  30. characters.  I would hope that's not a problem (but hey that's what they
  31. said about 640k as maximum memory).  In almost all cases, what you
  32. are looking for will be unique in about 80-100 characters, so this is
  33. really a moot point.
  34.  
  35.      Following are some examples of what you could type in to a text
  36. editor, followed by \BOLD exactly \BOLD what HT would display.    These are
  37. good examples of how to setup links.  Clicking on these links won't work
  38. however, because they are just examples.  If these examples seem
  39. complicated, remember that usually you will not have type in the link
  40. information by hand (see the file \link { Editors.txt } Editors.txt).
  41. \endlink
  42.  
  43. \freeformat
  44. \it \under EXAMPLES:\under \ital
  45.      1.)  The ancient Roman \\Link { emperors.txt Roman Emperors }
  46.       Emperors \\Endlink tended to be a bit \\Link { df1:caligula.story
  47.       Caligula } weird. \\Endlink
  48.  
  49. \format
  50.      The ancient Roman \link { emperors.txt "Roman Emperors"" }
  51. Emperors \endlink tended to be a bit \link { df1:caligula.story
  52. Caligula } weird. \endlink
  53.  
  54.     What example 1 does is setup two (2) links.  The first link is on the
  55. word 'Emperors', which is linked to the phrase 'Roman Emperors' in the file
  56. emperors.txt in the same directory.  Double clicking on Emperors would
  57. bring up another window with the file emperors.txt and the first occurence
  58. of 'Roman Emperors' at the top of the window.
  59.  
  60.     The second link is from the word 'weird' in the current file to the
  61. word 'Caligula' in the file df1:caligula.story.  Double clicking on 'weird'
  62. will automagically bring up a window with the file df1:caligula.story
  63. (assuming it exists) and the word 'Caligula' at the top.
  64.  
  65.  
  66. \freeformat
  67.      2.)  Washington D.C. is the \\Link { capitol.txt IX. What
  68.       is a Capitol } capitol \\Endlink of the United States.
  69.  
  70.       Washington D.C. is the \link { capitol.txt IX. What
  71.       is a Capitol } capitol \endlink of the United States.
  72.  
  73.     Pretty easy one to figure out.  The word 'capitol' is linked to the
  74. phrase "IX. What is a Capitol" in the file capitol.txt.  This is about as
  75. basic as a link can get, but shows how to link something in the current
  76. file to a section heading in another file.  This works nicely for easy
  77. cross indexing of chapters and references.
  78.  
  79. -------------------------------------------------------------------------
  80. \format
  81. \bold \\RUN { <someprogram and its options> } \bold
  82.  
  83.    The \\RUN command is used to set up a link between a word/phrase in
  84. the current document and some other program.  Anything between the
  85. opening curly brace ({) and the closing curly brace (}) is passed to the
  86. program which is assumed to be the first word in the {}'s.  Basically it
  87. is as if you typed the line at a CLI prompt.  The program that is run is
  88. completely independant from the HT program, and HT does \bold NOT\bold
  89. wait for it to complete (remember this is why you have an Amiga :).
  90.  
  91.    This function allows you to link to virtually any program.  Of course
  92. the are other commands that may be more appropriate, but if nothing else
  93. works, and this is your last resort, it should handle just about any
  94. case not handled by the other link commands.
  95.  
  96. \freeformat
  97.  NOTE:    If you are paranoid about someone doing destructive things
  98.     without your knowing, you can set the configuration option ASKFIRST
  99.     to "Yes/On" using the HTConfig utility. This will cause HT to pop
  100.     up a requestor showing what is about to be run and asking you if it
  101.     is ok.    If you say "OK", HT will execute the program, otherwise it
  102.     will do nothing.  I'm assuming people aren't out to do destructive
  103.     things.  If you aren't as sure about human nature, set the
  104.     configuration option ASKFIRST to "Yes/On", and you will be asked
  105.     prior to any programs' execution.
  106.  
  107.  
  108. \freeformat
  109. Examples:
  110.      1.)  This is some really insipid text, but it is linked to a really
  111.       jazzy \\Run { coolprogram -c -h arg1 arg2 } program \\Endlink.
  112.  
  113.      This is some really insipid text, but it is linked to a really
  114. jazzy \run { coolprogram -c -h arg1 arg2 } program \Endlink.
  115.  
  116.      This example sets up a link between the word program, and the program
  117.      called 'coolprogram'.  Coolprogram is passed as parameters "-c -h
  118.      arg1 arg2".  Clicking on the word 'program' causes HT to execute the
  119.      program called 'coolprogram' and pass it the parameters.
  120.  
  121.      2.)  This \\Run { df1:nifty/neeto arg1 } program has a full
  122.       pathname\\Endlink , but isn't really a problem.
  123.  
  124. \format
  125. This \run { df1:nifty/neeto arg1 } program has a full pathname,\Endlink but
  126. isn't really a problem.
  127.  
  128. \freeformat
  129.      What we have here is a program called "neeto" in the directory
  130.      df1:nifty/ which is to executed with the single argument arg1. when
  131.      someone clicks on the phrase "program has a full pathname".
  132.  
  133. --------------------------------------------------------------------------
  134.  
  135. \bold \\SOUND { <soundfilename> } \bold
  136.  
  137. \format
  138.     This command will create a link between a word/phrase and any sound
  139. file you want.    Double clicking the linked phrase triggers the sound you
  140. have specified to be played.
  141.  
  142.     The default program to run is SSP, somewhere in your path.    You can
  143. change this with HTConfig program.  You would change the SOUND option to
  144. the name of the program you want to use.
  145.  
  146. Examples:
  147.  
  148. \freeformat
  149. This first example will play the sound boink.sound whenever the words
  150. "boink sound" are double clicked on.
  151.  
  152.       1.)  The \\sound { boink.sound } boink sound \\endlink is a strange
  153.        one.
  154.  
  155.        The \sound { boink.sound } boink sound \endlink is a strange one.
  156.  
  157. Next, assuming that you are using the SSP program to play these sounds, you
  158. can also pass options to SSP like this:
  159.  
  160. \indent
  161. This is a slow \\sound {  -p200 boink.sound } boink sound
  162. \\endlink because it is played back at a much slower rate.
  163.  
  164. \format
  165. \indent
  166. This is a slow \sound {  -p200 boink.sound } boink sound
  167. \endlink because it is played back at a much slower rate.
  168.  
  169. Which plays the same sound as above, but at a much slower rate.
  170.  
  171. \format
  172.     Of course to end the link you should have an \\Endlink command at the
  173. end of your linked text.  This is important to remember or else the link
  174. will continue until an \\Endlink command is found.
  175.  
  176. --------------------------------------------------------------------------
  177.  
  178. \bold \\SHOW  { <iff picture name> } \bold
  179.  
  180.     If you would like a word or phrase to be linked to an IFF picture, you
  181. can use this command.  When the word or phrase is clicked on, the picture
  182. will be displayed (if possible).
  183.  
  184.     The default program to be run is SHOW, which should be in your path.
  185. If you would like to change this, use the HTConfig utility to change which
  186. program is used.
  187.  
  188. Examples:
  189.  
  190. \freeformat
  191.      This first example simply will display a picture called babylon.pic
  192. (which is in the current directory) when the user double clicks on the
  193. phrase "Hanging Gardens of Babylon".  Pretty straightforward.
  194.  
  195. \indent
  196. The \\show { babylon.pic } Hanging Gardens of Babylon \\endlink
  197. were one of the wonders of the ancient world.
  198.  
  199. \format
  200. \indent
  201. The \show { babylon.pic } Hanging Gardens of Babylon \endlink
  202. were one of the wonders of the ancient world.
  203.  
  204. \format
  205.     Of course to end the link you should have an \\Endlink command at the
  206. end of your linked text.  This is important to remember or else the link
  207. will continue until an \\Endlink command is found.
  208.  
  209. --------------------------------------------------------------------------
  210.  
  211. \bold \\ANIM { <anim name> } \bold
  212.  
  213.      Use of the \\Anim command will set up a link to the specified anim
  214. file.  When the user double clicks the highlighted text, the animation
  215. will be played.  This can be very useful for demonstrating concepts being
  216. read about in the document.
  217.  
  218.     The default program to be run is SHOWANIM, which should be in your
  219. path.  If you would like to change this, use the HTConfig utility to change
  220. which program is used.
  221.  
  222. Examples:
  223.  
  224. \freeformat
  225.     Here we will setup a link between an animation, atom.anim, and the word
  226. "electron" in the following sentence.  We will also pass some options to
  227. the ShowAnim program.
  228.  
  229. \indent
  230. In the atom, \\anim { -c -j3 df1:anims/atom.anim } electrons
  231. \\endlink whiz around the nuclues.
  232.  
  233. \format
  234. \indent
  235. In the atom, \anim { -c -j3 df1:anims/atom.anim } electrons
  236. \endlink whiz around the nuclues.
  237.  
  238. \format
  239.     Of course to end the link you should have an \\Endlink command at the
  240. end of your linked text.  This is important to remember or else the link
  241. will continue until an \\Endlink command is found.
  242.  
  243. --------------------------------------------------------------------------
  244.  
  245. \bold \\PLAY { <smus filename> } \bold
  246.  
  247.      The purpose of this command is to link words/phrases to music.  When
  248. double clicked on by the user, the corresponding <smus filename> will be
  249. played with any options you have specified in between the {}'s.
  250.  
  251.     The default program to be run is PLAY, which should be in your path. If
  252. you would like to change this, use the HTConfig utility to change which
  253. program is used.
  254.  
  255. Examples:
  256.  
  257. \freeformat
  258.    Here, assuming you use the Play program, it is almost essential to pass
  259. parameters.  You simply place the parameters you would have typed on the
  260. command line in between the {}'s.  These are passed to the play program
  261. which sees them as if you had typed them in a CLI.
  262.  
  263. \format
  264. \indent
  265. Jimi Hendrix wrote the song \\play { i=df1:instr df1:songs/purple
  266. haze.smus } Purple Haze.\\endlink
  267.  
  268. \indent
  269. Jimi Hendrix wrote the song \play { i=df1:instr df1:songs/purple
  270. haze.smus } Purple Haze.\endlink
  271.  
  272.  
  273. \format
  274.     Of course to end the link you should have an \\Endlink command at the
  275. end of your linked text.  This is important to remember or else the link
  276. will continue until an \\Endlink command is found.
  277.  
  278. --------------------------------------------------------------------------
  279.  
  280. \bold \\AREXX { <Arexx program, options, and arguments> } \bold
  281.  
  282.     This is a pretty neat keyword.  The \\Arexx keyword will start an Arexx
  283. program along with any options whenever the linked text is double clicked.
  284. If need be, the Arexx program can then talk back to HT through the main
  285. body port (HT).  This command is asynchronous.  Arexx replies to these
  286. messages \bold right \bold away, without waiting for the ARexx macro to
  287. finish executing.  What normally would happen is that your document would
  288. be "frozen" until the ARexx macro finished.  The \\Arexx keyword returns
  289. control to your document almost immediately.  The Arexx command you
  290. launched continues to run concurrently with your document.  Therefore the
  291. user is able to continue using your document without having to wait for the
  292. rexx program to exit.  If you want synchronous behavior, where the
  293. document is "frozen", use the \\REXX command (see down below).
  294.  
  295. \link { TechInfo AREXX Support } To find out more about HT's ARexx port and
  296. the commands it supports, click here.\endlink
  297.  
  298.     Any text that falls between the {}'s is passed directly to ARexx.  If
  299. you would be able to type it in the CLI, you are able to do the same thing
  300. here.  You specify the command name, options, and arguments, and ARexx
  301. takes care of the rest.  You should remember that ARexx must be able to
  302. find the command you would like to run.  Therefore it is usually best to
  303. make sure the command is reachable or that you specify a full path name.
  304.  
  305.     Via the \\AREXX and \\REXX keywords, you have a \ital very \ital
  306. powerful mechanism when creating documents.  Since ARexx is a standard
  307. language for inter program communication on the Amiga, it is possible to
  308. have your hypertext documents control your spreadsheet, your communications
  309. program, or your word processor.  Think of the help facility you can make
  310. with this!
  311.  
  312. \freeformat
  313. Examples:
  314.  
  315.      1.)  It is also possible to have the database program XYZZY sort by a
  316.       different field.  \\ARexx { sort_by_name.rexx } Click here to see
  317.       this done. \\endlink
  318.  
  319.     In this example we have a hypothetical database program, XYZZY, which
  320. has an ARexx port.  The documentation is describing how to sort on various
  321. fields, and an ARexx program is linked in which will actually demonstrate
  322. how to do this operation.  After double clicking the link, the user will
  323. immediately get control of the document back, and the Arexx macro will run
  324. to completion simultaneously, possibly opening its own windows etc.
  325.  
  326.      2.)  There is an \\Arexx { do_job.rexx -h some options } ARexx macro
  327.       \\Endlink to accomplish this complicated process.
  328.  
  329.     This example sets up a link with the words "ARexx macro" and the actual
  330. macro do_job.rexx.  We are also passing some options to this Arexx program.
  331. The options are arbitrary, and merely for display, but show you that the
  332. information in the link is as if you had typed it into a CLI.  When the
  333. users double clicks on the word "ARexx macro", the do_job.rexx program will
  334. be executed in parallel with the current document.
  335.  
  336. \format
  337.     Of course to end the link you should have an \\Endlink command at the
  338. end of your linked text.  This is important to remember or else the link
  339. will continue until an \\Endlink command is found.
  340.  
  341. --------------------------------------------------------------------------
  342.  
  343. \bold \\REXX { <Arexx program, options, and arguments> } \bold
  344.  
  345.      This is a synchronous version of the \\ARexx keyword.  When using this
  346. command, the message will be sent to Rexx, and the user will have to wait
  347. until the Arexx program finishes.  This can be a little disconcerting for
  348. the user if they don't get any feedback from the Rexx program.  What is
  349. meant by synchronous is that your document will not be able to be
  350. manipulated by the user \ital until the Arexx macro finishes.\ital   This
  351. is very important to keep in mind when planning how things should work.
  352. For more information, see the above lines on the \\AREXX keyword.
  353.  
  354. \freeformat
  355. Examples:
  356.  
  357.      1.) If you would like to see this process step by step, simply
  358.      \\rexx { show_steps.rexx -slow } click here.\\endlink
  359.  
  360.     This example will cause an ARexx macro to be executed (show_steps.rexx)
  361. when the user double clicks the phrase "click here".  This could be useful
  362. in that the user now has their attention directed on the new program, and
  363. cannot go back and follow other links.    This is helpful if you would have
  364. problems with multiple ARexx macros modifying shared data, or something
  365. similar.
  366.  
  367.     Of course to end the link you should have an \\Endlink command at the
  368. end of your linked text.  This is important to remember or else the link
  369. will continue until an \\Endlink command is found.
  370.  
  371.  
  372.