Prints a link to a graphics file into an HTML file (D.A. Murray).
Options
CHANNEL = scalar |
Output channel number of file; default current output channel |
---|---|
EXCLUDEPATH = string token |
Whether to remove path information when printing the link (yes , no ); default no |
Parameter
FILENAME = texts |
Name of the graphics file to be linked within the html file |
---|
Description
PLINK can be used to insert a link within an html file to display a graphics file such as a Portable Network Graphics (PNG) or JPEG file. The link is written within the output file using the html tag. For example, the html code for a graph called
CapeWagtail.jpg
would be written as:
The name of the graphics file to appear in the link is supplied using the FILENAME
parameter. The CHANNEL
option determines where the output appears. By default, the output is printed to the current output channel, but CHANNEL
can be set to a scalar to send it to another output channel. This output channel must have been opened in HTML style. The correspondence between channels and files on the computer is explained in the description of the OPEN
directive.
The full details of the file name, including any path information, are written within the link by default. You can exclude path information from the link by setting option EXCLUDEPATH=yes
.
Options: CHANNEL
, EXCLUDEPATH
.
Parameter: FILENAME
.
Method
The link is written using PRINT
with the typesetting command ~h{}
, to ensure the correct style of output within the HTML file.
See also
Directive: OPEN
.
Commands for: Input and output.
Example
CAPTION 'PLINK example'; STYLE=meta " make a local copy of the Cape Wagtail picture " GET [WORKINGDIRECTORY=wdir] TXCONSTRUCT [TEXT=jpgfile] wdir,'\\CapeWagtail.jpg' FCOPY OLD='%GENDIR%/Examples/GuidePart1/CapeWagtail.jpg';\ NEW=jpgfile; OVERWRITE=yes " insert a link to the picture into the file MyHTML.htm " SCALAR outhtm OPEN 'MyHTML.htm'; CHANNEL=outhtm; FILETYPE=output; STYLE=html PLINK [CHANNEL=outhtm; EXCLUDEPATH=yes] jpgfile CLOSE outhtm; FILETYPE=output