home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ascii2cp.zip
/
xhtml.kex
< prev
Wrap
Text File
|
2002-05-18
|
6KB
|
99 lines
'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */
/* Usage: [MACRO] XHTML */
/* Purpose: Convert a text/plain IBM850 file to XHTML, only */
/* characters visible with either netscape 2.02 or */
/* WebExplorer 1.1d (or both) are translated. All */
/* conflicts are counted. */
/* Bugs: ' not used (works only with WebExplorer), */
/* € requires netscape 4.x (maybe try ) */
/* • requires netscape 4.x (maybe try ) */
/* ƒ does not work at all (maybe try ) */
/* Requires: Kedit 5.0 (Frank Ellermann, 2002) */
C = 0 ; N = 0 ; W = 0 ; T = fn.2() || '.' || ft.2()
'ft htm' ; 'eofout eol' ; if rc <> 0 then exit
call ENTITY '&', 'amp' ; call ENTITY '"', 'quot'
call ENTITY '<', 'lt' ; call ENTITY '>', 'gt'
call ENTITY '∩', 'acute' ; call ENTITY '▌', 'brvbar'
call ENTITY 'á', 'aacute' ; call ENTITY '╡', 'Aacute'
call ENTITY 'é', 'eacute' ; call ENTITY 'É', 'Eacute'
call ENTITY 'í', 'iacute' ; call ENTITY '╓', 'Iacute'
call ENTITY 'ó', 'oacute' ; call ENTITY 'α', 'Oacute'
call ENTITY 'ú', 'uacute' ; call ENTITY 'Θ', 'Uacute'
call ENTITY 'â', 'acirc' ; call ENTITY '╢', 'Acirc'
call ENTITY 'ê', 'ecirc' ; call ENTITY '╥', 'Ecirc'
call ENTITY 'î', 'icirc' ; call ENTITY '╫', 'Icirc'
call ENTITY 'ô', 'ocirc' ; call ENTITY 'Γ', 'Ocirc'
call ENTITY 'û', 'ucirc' ; call ENTITY 'Ω', 'Ucirc'
call ENTITY 'à', 'agrave' ; call ENTITY '╖', 'Agrave'
call ENTITY 'è', 'egrave' ; call ENTITY '╘', 'Egrave'
call ENTITY 'ì', 'igrave' ; call ENTITY '▐', 'Igrave'
call ENTITY 'ò', 'ograve' ; call ENTITY 'π', 'Ograve'
call ENTITY 'ù', 'ugrave' ; call ENTITY 'δ', 'Ugrave'
call ENTITY '∙', 'uml' ; call ENTITY 'ÿ', 'yuml'
call ENTITY 'ä', 'auml' ; call ENTITY 'Ä', 'Auml'
call ENTITY 'ë', 'euml' ; call ENTITY '╙', 'Euml'
call ENTITY 'ï', 'iuml' ; call ENTITY '╪', 'Iuml'
call ENTITY 'ö', 'ouml' ; call ENTITY 'Ö', 'Ouml'
call ENTITY 'ü', 'uuml' ; call ENTITY 'Ü', 'Uuml'
call ENTITY 'æ', 'aelig' ; call ENTITY 'Æ', 'AElig'
call ENTITY 'å', 'aring' ; call ENTITY 'Å', 'Aring'
call ENTITY '╞', 'atilde' ; call ENTITY '╟', 'Atilde'
call ENTITY '≈', 'cedil' ; call ENTITY '°', 'deg'
call ENTITY 'ç', 'ccedil' ; call ENTITY 'Ç', 'Ccedil'
call ENTITY '╜', 'cent' ; call ENTITY '╧', 'curren'
call ENTITY '╨', 'eth' ; call ENTITY '╤', 'ETH'
call ENTITY '¿', 'iquest' ; call ENTITY '¡', 'iexcl'
call ENTITY '«', 'laquo' ; call ENTITY '»', 'raquo'
call ENTITY 'µ', 'micro' ; call ENTITY '·', 'middot'
call ENTITY '¬', 'not' ; call ENTITY '±', 'plusmn'
call ENTITY 'ñ', 'ntilde' ; call ENTITY 'Ñ', 'Ntilde'
call ENTITY 'ª', 'ordf' ; call ENTITY 'º', 'ordm'
call ENTITY '¢', 'oslash' ; call ENTITY '¥', 'Oslash'
call ENTITY 'Σ', 'otilde' ; call ENTITY 'σ', 'Otilde'
call ENTITY d2c(20), 'para' ; call ENTITY d2c(21), 'sect'
call ENTITY '⌠', 'para' ; call ENTITY '⌡', 'sect'
call ENTITY '£', 'pound' ; call ENTITY '╛', 'yen'
call ENTITY '⌐', 'reg' ; call ENTITY '╕', 'copy'
call ENTITY '½', 'frac12' ; call ENTITY '¼', 'frac14'
call ENTITY '≤', 'frac34' ; call ENTITY '√', 'sup1'
call ENTITY '²', 'sup2' ; call ENTITY 'ⁿ', 'sup3'
call ENTITY ' ', 'nbsp' ; call ENTITY 'ß', 'szlig'
call ENTITY 'τ', 'thorn' ; call ENTITY 'Φ', 'THORN'
call ENTITY '₧', 'times' ; call ENTITY '÷', 'divide'
call ENTITY '∞', 'yacute' ; call ENTITY 'φ', 'Yacute'
W = W + ENTITY( '≡', 'shy' ) ; W = W + ENTITY( 'ε', 'macr' )
C = C + ENTITY( d2c(7 ), 'bull' ) /* netscape 4.x has bullet */
C = C + ENTITY( '╒', 'euro' ) /* netscape 4.x has euro */
N = N + ENTITY( d2c(24), 'uarr' ) /* WebExplorer 1.1d has 3 */
N = N + ENTITY( d2c(26), 'rarr' ) /* arrows, but neither 25: */
N = N + ENTITY( d2c(27), 'larr' ) /* ↓ nor 29: ↔ */
'extract /INPUTMODE' ; 'inputmode off' ; ':0'
'i <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://validator.w3.org/sgml-lib/REC-xhtml1-20000126/xhtml1-transitional.dtd">'
'i <html lang="en"><head>' ; W = W + C ; N = N + C
'i <meta http-equiv="Content-type" content="text/html; charset=us-ascii" />'
'i <meta name="description" content="' || T || '" />'
'i <title>' T '</title><base target="_top" />'
'i </head><body onload="if (parent.location != location) parent.location=location">'
'i <!--' copies( '=', 59 ) '--><br /><pre>' ; ':*'
'i <!--' copies( '=', 59 ) '--></pre>'
'i <hr /><address>' ; T = date() time.2()
'i <a href="http://validator.w3.org/check/referer"><img src="valid.jpg" height="31" width="88" align="right" alt="XHTML validator" /></a>'
'i Last update:' T 'by <a href="http://frank.ellermann.bei.t-online.de/index.htm">F. </a><a href="http://home.t-online.de/~frank.ellermann/index.htm">Ellermann</a>'
'i </address></body></html>' ; 'inputmode' INPUTMODE.1
if N <> 0 & W <> 0 then 'emsg text is not visible with any browser'
else if W <> 0 then say 'text incompatible with WebExplorer 1.1d'
else if N <> 0 then say 'text incompatible with Netscape 2.02'
exit sign( N * W )
ENTITY: procedure
'nomsg change' delimit( arg( 1 ), '&' || arg( 2 ) || ';' ) 'all *'
return ( rc = 0 )