owner=Michael Grobe
%%owner_address=grobe@ukanaix.cc.ukans.edu
%%owner_info=University of Kansas, Academic Computing Services
link_delimiter=<

		Link Display Fields and Target Strings

Aside from  specifying files to be displayed,  links can  also specify
the  number of  characters following the  link to be  highlighted.  In
addition, they can   include a target  string  that  determines  which
portion of the designated (target) file to display first.  For example
the link

			<<cs200:41:CS 200>

specifies that the the first  41 characters  following the link should
be highlighted, and instructs  Lynx to search for the  string "CS 200"
in the target file.

The general syntax for a link pointing to a local file to be displayed
can be represented as:

	link_delimiter   pathname
		token_delimiter   character_count
			token_delimiter   target_string
				end_link_delimiter


which relates to the example as follows:

			<<  cs200	     :  41   :  CS 200   >
	                |     |              |   |   |   |       |
                        |     |              |   |   |   |       |
        link_delimiter  |     |              |   |   |   |       |
                     pathname |              |   |   |   |       |
                                             |   |   |   |       |
                               token_delimiter   |   |   |       |
                                   character_count   |   |       |
                                       token_delimiter   |       |
                                             target_string       |
                                                end_link_delimiter 

 

In this syntax  description the link delimiter must  be defined in the
Lynx file preamble; there is no default.   The end_link_delimiter is a
right  angle bracket (>)  by default, and the token_delimiter defaults
to a colon (:).  character_count is an integer that specifies how many
characters following the  link  end_delimiter are   to be highlighted.
target_string  specifies a  string  to be  searched  for in the target
file.  Blanks are allowed in target  strings since  target strings are
delimited by the colon  and the end_link_delimiter.  Delimiters may be
included in target  strings by  escaping  them with  a backslash  (\).
Target string   searches  are case sensitive,  and  links  embedded in
target   files are    not   searched  for   target   strings.     Both
character_count   and     the  target_string    are     optional,  and
token_delimiters may be omitted when unnecessary.

A similar link that references a file residing on a Gopher server

	<<0-0/cs200@ukanaix.cc.ukans.edu 70: 41:CS 200>

can be represented by a slightly more detailed syntax:

	link_delimiter   gopher_file_type -  gopher_pathname
		@hostname   port_number
			token_delimiter   character_count
				token_delimiter   target_string
					end_link_delimiter

where gopher_pathname, port_number, character_count and target_string are 
all optional.

A variation on the earlier example demonstrates one  way the character
count and target string features can be used:


LINK_DELIMITER = <<
END_LINK_DELIMITER = >
OWNER = Michael Grobe
OWNER_ADDRESS = grobe@kuhub.cc.ukans.edu
OWNER_INFO = Academic Computing Services,University of Kansas

     The Computer Science Department is offering the
   following classes during the Spring Semester of 1992


<<courses:41:CS 200>CS 200   Introduction to Computer Science      
MWF  3:30
         104 Strong Hall       A Lovelace

<<courses:40:CS 600>CS 600   Introduction to Data Structures       
TR   2:30
         210 Snow Hall         A Turing


This file assumes that descriptions of each course are collected  in a
single file named courses in the same directory as the timetable file.
When one of the links above is  activated, the file "courses"  will be
searched to find the first occurrence of the  target string.  Then the
portion of the target  file containing  the  first occurrence will  be
displayed.

The courses file being used with this timetable file might look like:


OWNER = Michael Grobe
OWNER_ADDRESS = grobe@kuhub.cc.ukans.edu
OWNER_INFO = Academic Computing Services,University of Kansas

CS 200   Introduction to Computer Science

     CS 200 introduces students to the basic concepts of 
computing.  Topics include algorithm development, computer 
organization, and the syntax and semantics of a high-level 
programming language.


CS 600   Introduction to Data Structures

     CS 600 presents data structures and algorithms commonly 
used in computer programming.  Linked lists, arrays, trees, 
and graphs are covered.  Algorithms for creating, filling, 
searching, sorting, traversing these structures are covered.


When activated  through the first link,  the courses file would appear
as follows on the screen:


CS 200   Introduction to Computer Science

     CS 200 introduces students to the basic concepts of 
computing.  Topics include algorithm development, computer 
organization, and the syntax and semantics of a high-level 
programming language.


CS 600   Introduction to Data Structures

     CS 600 presents data structures and algorithms commonly 
used in computer programming.  Linked lists, arrays, trees, 
and graphs are covered.  Algorithms for creating, filling, 
searching, sorting, traversing these structures are covered.


Both  occurrences of  the string  "CS  200"  would   be underlined (or
otherwise indicated, depending on the video display), since both would
be found by the text search.

In some cases it   might be  necessary to  move the user   to  a later
occurrence of the target string, or to  a place in the target document
not readily  identifiable by a  string.  To do  that it is possible to
put   hidden targets in Lynx documents.    A hidden target  is  a text
string surrounded  by target delimiters.   Hidden targets are searched
during string searches, but are not displayed with the other text in a
Lynx  document.  The following  version of   the courses file contains
hidden targets surrounded by specified target delimiters:


TARGET_DELIMITER = [*
END_TARGET_DELIMITER = *]
OWNER = Michael Grobe
OWNER_ADDRESS = grobe@kuhub.cc.ukans.edu
OWNER_INFO = Academic Computing Services,University of Kansas

[*CS200_target*]CS 200   Introduction to Computer Science

     CS 200 introduces students to the basic concepts of 
computing.  Topics include algorithm development, computer 
organization, and the syntax and semantics of a high-level 
programming language.


[*CS600_target*]CS 600   Introduction to Data Structures

     CS 600 presents data structures and algorithms commonly 
used in computer programming.  Linked lists, arrays, trees, 
and graphs are covered.  Algorithms for creating, filling, 
searching, sorting, traversing these structures are covered.


To activate this file, the following links  would be used  in place of
the ones used earlier in the timetable file:

   <<courses::CS200_target>CS 200	etc.

   <<courses::CS600_target>CS 600	etc.

When activated   through the  first link, the  new courses  file would
appear as follows on the screen:


CS 200   Introduction to Computer Science

     CS 200 introduces students to the basic concepts of 
computing.  Topics include algorithm development, computer 
organization, and the syntax and semantics of a high-level 
programming language.


CS 600   Introduction to Data Structures

     CS 600 presents data structures and algorithms commonly 
used in computer programming.  Linked lists, arrays, trees, 
and graphs are covered.  Algorithms for creating, filling, 
searching, sorting, traversing these structures are covered.


In  general, the text in  a target  file  between an  activated hidden
target and  the  next  newline  will appear underlined.    Since  Lynx
searches  both  text and   hidden targets when  looking  for  a target
string, care must be taken to assure that  targets are unique to avoid
mispositioning.

Note  that the  default target_delimiter is  the  two character string
left      square    bracket-asterisk     ([*),  and     the    default
end_target_delimiter is   the string asterisk-  right   square bracket
(*]).   These variables  were explicitly  defined in  this example for
clarity.   Also, the target_string  and character_count entries may be
null; token delimiters are only required to identify the last non-null
parameter in the link.

In  some cases it  is useful to   use  targets to identify links  in a
target  file.   For example, suppose you  wish to allow  users to move
back  and forth  between the timetable  information   for CS600 to the
course description for  CS600.  The following line could  be placed in
the timetable file to move users  from  the  timetable information for
CS600 to  the course description for CS600,  and to  receive transfers
from the courses file:

[*CS600_times*]<<courses:40:CS600_target>
CS 600   Introduction to Data Structures       TR   2:30

Then the following link could be placed in the courses file to move users from 
the course information for CS 600 to the timetable information for CS 600:

[*CS600_target*]<</info/cs/timetable:40:CS600_times>CS 600   
Introduction to Data Structures

If a hidden  target is immediately adjacent  to an embedded  link, the
target must appear before the link.
