1 REM "text2html.rfd" / Created Friday, 1 September 2000 by Richard F. Drushel 2 REM filter program for TWWMCA text files, to turn them into 1st-order HTML '*************************************************************************** CONST VERSION$ = "04" 'version history '04 0009.10 ;added navigator HTML to footer. '03 0009.03 ;removed check for capital letter in ICLASSIFYLINE, as it ' ;turns out I never used letter-outline format! However, I ' ;have used number-outline format, so add this check. Number ' ;outlines get put between
and
block flag to not pre-formatted
ipara = 0 'initialize flag to not in a paragraph
inumlist = 0 'initialize
block flag (0=not in a'block, 1=in ablock), ipara=paragraph flag (0=not in a paragraph, '1=in a paragraph) 'on exit, x$ is the processed text line x$ = DETRAIL$(x$) 'strip trailing spaces and tabs 'check for
and(these will always be on separate lines) SELECT CASE x$ CASE IS = "" ipre = 1 'toggleblock flag on CASE IS = "" ipre = 0 'toggleblock flag off CASE ELSE IF ipre = 1 THEN 'just print the string as-is ELSE 'check for paragraphs x$ = DELEAD$(x$) 'strip leading spaces and tabs x$ = TRAPSPECIAL$(x$) 'trap & < > for HTML IF ipara = 1 THEN 'we're in a paragraph, but is this the blank line of 'separation at the end of the paragraph? IF x$ = "" THEN 'yes, paragraph is done PRINT #3, "" 'close the paragraph ipara = 0 'not in paragraph anymore 'the blank line in x$ gets printed by caller ELSE 'no, just print the line as-is END IF ELSE 'not already in a paragraph; where are we? IF inumlist = 1 THEN 'we're in a numeric list already 'must do same check for blank line of separation 'that we do in paragraphs IF x$ = "" THEN 'yes, list is done PRINT #3, "
" + x$ inumlist = 1 'flag that we're now 'in a number list CASE IS = 3 'This Week With My Coleco ADAM x$ = "
by Richard F. Drushel (drushel@apk.net)
" CASE ELSE '5 and up gets treated as a paragraph x$ = "" + x$ ipara = 1 'flag that we're in a paragraph END SELECT END IF END IF END IF END SELECT RETURN '*************************************************************************** 'header data DATA DATA DATA
DATANext Article
DATA Previous Article
DATA TWWMCA Archive Main Page