#
#	html-image.wl
#
#	Implements a way to create images and image links
#	without using WebLord's IMAGE structure. WebLord
#	implements the 'image-url' keywords internally,
#	so we need to use a different keyword, such as
#	'image-src' here.
#
#	Define a new image this way:
#
#		text = my-image
#		{
#			image-src =	"pix/test.gif";
#			image-width =	"128";
#			image-height =	"72";
#			image-align =	"left";
#			image-border =	"0";
#			image-hspace =	"4";
#			image-vspace =	"1";
#			image-alt =	"A test image";
#			link-to =	"http://my.site/pix/test-big.gif";
#		}
#
#	Then merely reference the object the way you would reference
#	an IMAGE object!
#
text = html-image
{
	ifdef = image-src;
	value = html-image-link-start
		"<img" html-image-spec ">"
		html-image-link-end;
	
}

text = html-image-spec
{
	value = html-image-src
		html-image-width
		html-image-height
		html-image-align
		html-image-border
		html-image-hspace
		html-image-vspace
		html-image-alt;
}

text = html-image-link-start	{ ifdef = link-to;	value = "<a href=\"" link-to "\">"; }
text = html-image-link-end	{ ifdef = link-to;	value = "</a>"; }

text = html-image-src		{ 			value = " src=\"" image-src "\""; }
text = html-image-width 	{ ifdef=image-width;	value = " width=\"" image-width "\""; }
text = html-image-height	{ ifdef=image-height;	value = " height=\"" image-height "\""; }
text = html-image-align		{ ifdef=image-align;	value = " align=\"" image-align "\""; }
text = html-image-border	{ ifdef=image-border;	value = " border=\"" image-border "\""; }
text = html-image-hspace	{ ifdef=image-hspace;	value = " hspace=\"" image-hspace "\""; }
text = html-image-vspace	{ ifdef=image-vspace;	value = " vspace=\"" image-vspace "\""; }
text = html-image-alt		{ ifdef=image-alt;	value = " alt=\"" image-alt "\""; }
