! ! HTML BLOCK command -- create blocks for HTML authoring, utilizing ! reasonable formatting of begin/end, newlines, etc. ! PROCEDURE EVE_HTML_BLOCK( WHAT_BLOCK) LOCAL BLOCK_NAME; IF EVE$PROMPT_STRING( WHAT_BLOCK, BLOCK_NAME, "<", "No block specified") THEN EDIT( BLOCK_NAME, UPPER, TRIM); CASE BLOCK_NAME [ "ADDRESS", "BLOCKQUOTE", "BODY", "DIR", "DL", "DL COMPACT", "HEAD", "HTML", "LISTING", "MENU", "OL", "PLAINTEXT", "PRE", "UL"]: ! ! Begin and end the block on separate lines, around ! the lines of included text. ! COPY_TEXT( "<" + BLOCK_NAME + ">"); EVE_RETURN; EVE_RETURN; COPY_TEXT( ""); move_horizontal( -length(block_name) - 3); move_vertical( -1); [ "TITLE", "H1", "H2", "H3", "H4", "H5", "H6", "A", "B", "EM", "I", "STRONG", "CODE", "SAMP", "VAR", "KBD", "CITE", "U", "TT" ]: ! ! Surround the block, all on the same line. ! COPY_TEXT( "<" + BLOCK_NAME + ">"); COPY_TEXT( ""); move_horizontal( -length(block_name) - 3); [ "DD", "DT", "LI" ]: ! ! For List elements, just insert the text in ! angle brackets. There is no closing form. ! COPY_TEXT( "<" + BLOCK_NAME + ">"); [ "BR" ]: ! ! End a line. ! COPY_TEXT( "<" + BLOCK_NAME + ">"); EVE_RETURN; [ "P" ]: ! ! End a paragraph. ! COPY_TEXT( "

"); EVE_RETURN; EVE_RETURN; [ "HR" ]: ! ! Insert a horizontal rule. ! EVE_RETURN; COPY_TEXT( "


"); EVE_RETURN; [ "!", "!--" ]: ! ! Comment -- another special case. ! COPY_TEXT( ""); MOVE_HORIZONTAL( -4); [ INRANGE, OUTRANGE ]: ! ! Unknown type. Default to in-line, begin/end. ! Then, warn the user. ! COPY_TEXT( "<" + BLOCK_NAME + ">"); COPY_TEXT( ""); MOVE_HORIZONTAL( -LENGTH( BLOCK_NAME) - 3); MESSAGE( "Warning: Unknown block " + BLOCK_NAME); ENDCASE; UPDATE( CURRENT_WINDOW); ENDIF; ENDPROCEDURE