; ; Macro Name: htmlgen ; Author: Dana French ; Author E-mail: dfrench@xoommail.com ; ; Creation Date: 11/19/1998 ; Version: 1.0 ; ; This macro only works with MicroEMACS Version 3.12 ; There is a separate version of this macro which ; works with MicroEmacs 4.00. ; set %bgcolor "white" ; background color set %textcolor "black" ; text color set %linkcolor "blue" ; link color set %vlinkcolor "red" ; Viewed link color set %alinkcolor "yellow" ; Active link color set %headercolor "darkblue" ; header font color set %tcfontcolor "darkblue" ; table caption color set %thcolor "lightblue" ; table header color set %tdcolor "white" ; table data color set %hrcolor "red" ; horizontal rule color set %hrsize "5" ; horizontal rule size set %frmbordersize "3" ; Frame Border Size set %basefontsize "4" ; base font size set %basefontcolor "black" ; base font color set %thfontcolor "darkblue" ; table header font color set %tdfontcolor "black" ; table data font color set %basefontsize "4" ; base font size set %tcfontsize "5" ; table caption font size set %thfontsize "4" ; table header font size set %tdfontsize "3" ; table data font size set %tablewidth "100~%" ; table width set %tableborder "2" ; table border size set %cellspacing "2" ; table cell spacing size set %cellpadding "2" ; table cell padding size set %dtfontcolor "black" ; Definition List term color set %dtfontsize "4" ; Definition List term size set %ddfontcolor "black" ; Definition List term explanation color set %ddfontsize "3" ; Definition List term explanation size set %addrfontcolor "black" ; Address Section Font Color set %addrfontsize "2" ; Address Section Font Size set %tablecaption "1" ; Table caption ON set %tableheader "1" ; Table header ON set %imgtag "0" ; IMG tag OFF set %htmlhelp "0" ; set %headimport "/usr/local/html/head.html" ; set %frameimport "/usr/local/html/framehead.html" ; set %footimport "/usr/local/html/foot.html" ; set %pagetitle "" ; initialize to NULL set %author "" ; initialize to NULL set %email "" ; initialize to NULL ;################################################################ 1 store-macro ; Generate Generic HTML Header set %htmljava 1 set %pagetitle @"Title of this page? " set %author @"Page Authors Name? " set %email @"Page Authors E-mail Address? " insert-string "~n" execute-procedure headsection execute-procedure bodysection set %htmljava 0 !endm 2 store-macro ; Import HTML Header File set %curcol $curcol set %question &cat &cat "Import HTML Header File Name (" %headimport ")? " set %impfile @%question !if &seq %impfile "" set %impfile %headimport !endif !if ¬ &seq %impfile "" insert-file %impfile !endif set %pagetitle @"Title of this page? " set %author @"Page Authors Name? " set %email @"Page Authors E-mail Address? " beginning-of-file replace-string "[[PAGETITLE]]" %pagetitle beginning-of-file replace-string "[[AUTHOR]]" %author beginning-of-file replace-string "[[EMAIL]]" %email end-of-file !endm 3 store-macro set %noop 0 !endm 4 store-macro set %noop 0 !endm ;################################################################ 5 store-macro ; Generate FRAME page set %curcol $curcol set %pagetitle @"Title of this page? " set %author @"Page Authors Name? " set %email @"Page Authors E-mail Address? " insert-string "~n" execute-procedure headsection insert-string "~n" insert-string "~n" execute-procedure headsection execute-procedure bodysection insert-string "<P Align=~"center~"><B><FONT SIZE=6 COLOR=~"black~">I'm Sorry</FONT></B></P>~n" insert-string "<P>This web page cannot be viewed unless you have an~n" insert-string "Internet browser with a special capability called ~"Frames.~" Some older~n" insert-string "browsers don't support frames. The current browsers from Netscape,~n" insert-string "Microsoft and AOL all support frames.</P>~n" insert-string "<P>You can download (obtain) them by visiting one of the sites below.~n" insert-string "(Make sure you come back, now.)</P>~n" insert-string "<P Align=~"center~">~n" insert-string "<A HREF=~"http://www.netscape.com/~">Netscape</A>~n" insert-string " | <A HREF=~"http://www.microsoft.com/ie/~">Microsoft Internet Explorer</A>~n" insert-string " | <A HREF=~"http://www.aol.com~">America Online</A>~n" insert-string "</P>~n" insert-string "</BODY>~n" insert-string "~n" update-screen execute-procedure mkframes insert-string "~n" !endm 6 store-macro ; FRAMES set %curcol $curcol set %question &cat &cat "Import Frame Header File Name (" %frameimport ")? " set %impfile @%question !if &seq %impfile "" set %impfile %frameimport !endif set %pagetitle @"Title of this page? " set %author @"Page Authors Name? " set %email @"Page Authors E-mail Address? " beginning-of-file replace-string "[[PAGETITLE]]" %pagetitle beginning-of-file replace-string "[[AUTHOR]]" %author beginning-of-file replace-string "[[EMAIL]]" %email end-of-file !if ¬ &seq %impfile "" insert-file %impfile update-screen execute-procedure mkframes insert-string "~n" !endif !endm 7 store-macro set %noop 0 !endm 8 store-macro set %noop 0 !endm ;################################################################ 9 store-macro ; STANDARD HEADERS set %curcol $curcol set %size @"Header Size (1,2,3,4,5,6)? " set %htext @"Header Text? " set %center @"Center the Header (Y/N)? " !if &or &seq %center "Y" &seq %center "y" insert-string "
~n" %curcol insert-string " " !endif !if &seq %size "" set %size 1 !endif insert-string "" insert-string "" insert-string %htext insert-string "" insert-string "~n" !if &or &seq %center "Y" &seq %center "y" %curcol insert-string " " insert-string "
~n" !endif insert-string "~n" %curcol insert-string " " !endm 10 store-macro ; HEADER USING FONT/B set %curcol $curcol set %size @"Header Size (1,2,3,4,5,6)? " set %htext @"Header Text? " set %center @"Center the Header (Y/N)? " !if &or &seq %center "Y" &seq %center "y" insert-string "
~n" %curcol insert-string " " !endif !if &seq %size "" set %size 1 !endif set %size &neg &sub %size 8 insert-string "

" insert-string %htext insert-string "

~n" !if &or &seq %center "Y" &seq %center "y" %curcol insert-string " " insert-string "
~n" !endif insert-string "~n" %curcol insert-string " " !endm 11 store-macro set %noop 0 !endm 12 store-macro set %noop 0 !endm ;################################################################ 13 store-macro ; Horizontal Rule using table set %curcol $curcol insert-string "~n~n" %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string " 

~n" insert-string "~n" insert-string "~n" %curcol insert-string " " !endm 14 store-macro set %curcol $curcol insert-string "~n~n" %curcol insert-string " " insert-string "


~n" insert-string "~n" insert-string "~n" %curcol insert-string " " !endm 15 store-macro set %curcol $curcol insert-string "~n~n" %curcol insert-string " " insert-string "


~n" insert-string "~n" insert-string "~n" %curcol insert-string " " !endm 16 store-macro set %noop 0 !endm ;################################################################ ; long - caption and header section 17 store-macro set %rows @"Build Table: How many rows? " set %cols @"Build Table: How many columns? " set %center @"Center the Table (Y/N)? " set %curcol $curcol !if &seq %rows "" set %rows 1 !endif !if &seq %cols "" set %cols 1 !endif insert-string "

~n" !if &or &seq %center "Y" &seq %center "y" %curcol insert-string " " insert-string "

~n" !endif %curcol insert-string " " insert-string "~n" !if &equ %tablecaption 1 %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string "

~n" !endif !if &equ %tableheader 1 %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string "

~n" set %ccnt 0 !while &les %ccnt %cols set %ccnt &add %ccnt 1 %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" !endwhile %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "

~n" !endif set %rcnt 0 !while &les %rcnt %rows set %rcnt &add %rcnt 1 %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string "

~n" set %ccnt 0 !while &les %ccnt %cols set %ccnt &add %ccnt 1 %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" !endwhile %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "

~n" !endwhile %curcol insert-string " " insert-string "
" insert-string "~n" insert-string "This is the table caption~n" %curcol insert-string " " insert-string " " insert-string "
~n" %curcol insert-string " " insert-string " ~n" insert-string "Header " insert-string %ccnt insert-string "~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
~n" %curcol insert-string " " insert-string " ~n" ; insert-string "Data " ; insert-string %ccnt ; insert-string "~n" insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
~n" !if &or &seq %center "Y" &seq %center "y" %curcol insert-string " " insert-string "
~n" !endif %curcol insert-string " " insert-string "

~n" insert-string "~n" %curcol insert-string " " !endm ; short - no caption and no header section 18 store-macro set %tablecaption 0 set %tableheader 0 execute-macro-17 set %tablecaption 1 set %tableheader 1 !endm ; medium - caption but no Header 19 store-macro set %tablecaption 1 set %tableheader 0 execute-macro-17 set %tablecaption 1 set %tableheader 1 !endm ; medium - header but no caption 20 store-macro set %tablecaption 0 set %tableheader 1 execute-macro-17 set %tablecaption 1 set %tableheader 1 !endm ;################################################################ ; Ordered/Unordered Lists 21 store-macro set %curcol $curcol set %typelist @"Ordered or Unordered List (O/U)? " set %rows @"List: How many rows? " set %center @"Center the List (Y/N)? " !if &seq %rows "" set %rows 1 !endif insert-string "

~n" !if &or &seq %center "Y" &seq %center "y" execute-procedure centerstart !endif !if &or &seq %typelist "O" &seq %typelist "o" insert-string "

    ~n" !else insert-string "
~n" !else insert-string "~n" !endif !if &or &seq %center "Y" &seq %center "y" execute-procedure centerend set %rows &add %rows 6 !endif %curcol insert-string " " insert-string "

~n~n" %curcol insert-string " " ; %rows previous-line ; 2 previous-line ; end-of-line !endm ; Definition List 22 store-macro set %curcol $curcol set %terms @"Definition List: How many terms? " set %links @"Create Terms as Links (Y/N)? " set %center @"Center the List (Y/N)? " !if &seq %terms "" set %terms 1 !endif insert-string "

~n" %curcol insert-string " " !if &or &seq %center "Y" &seq %center "y" execute-procedure centerstart !endif ; insert-string "

~n" ; %curcol insert-string " " insert-string "

~n" set %tcnt 0 !while &les %tcnt %terms set %tcnt &add %tcnt 1 %curcol insert-string " " insert-string "

~n" %curcol insert-string " " insert-string "

  • " !if &or &seq %links "Y" &seq %links "y" insert-string "" !endif insert-string "Term " insert-string %tcnt !if &or &seq %links "Y" &seq %links "y" insert-string "" !endif insert-string "~n" %curcol insert-string " " insert-string "
    ~n" insert-string "This is an explanation of term " insert-string %tcnt insert-string "~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "
  • ~n" %curcol insert-string " " insert-string "

    ~n" !endwhile %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "

    ~n" !if &or &seq %center "Y" &seq %center "y" execute-procedure centerend set %rows &add %rows 6 !endif %curcol insert-string " " ; insert-string "

    ~n~n" ; %curcol insert-string " " ; search-reverse ">Term 1<" ; forward-character !endm 23 store-macro set %curcol $curcol set %url @"Anchor: Link URL? " set %anchorname @"Anchor: Anchor Name? " !if &seq %anchorname "" set %anchorname %url !endif insert-string " !else insert-string "~" Href=~"" insert-string %url insert-string "~"> !if &equ %imgtag 1 execute-macro-24 !else set %urltext @"Anchor: Link Text? " insert-string %urltext !endif !endif insert-string "~n" %curcol insert-string " " !endm 24 store-macro set %url @"Image: Graphic file URL? " insert-string "" !endm ;################################################################ 25 store-macro set %imgtag 1 execute-macro-23 set %imgtag 0 !endm 26 store-macro set %noop 0 !endm 27 store-macro set %noop 0 !endm ;################################################################ 29 store-macro ; import an file set %curcol $curcol set %impfile @"Import File? " insert-string "

    ~n" insert-file %impfile insert-string "

    ~n" !endm 30 store-macro set %curcol $curcol set %impfile @"Import Preformatted File? " insert-string "

    ~n~n"
      insert-file %impfile
      insert-string "~n

    ~n" !endm 31 store-macro insert-string "<" !endm 32 store-macro insert-string "&" !endm ;################################################################ 33 store-macro set %curcol $curcol set %question &cat &cat "Title of this page? (" %pagetitle ") " set %tmpbuffer @%question !if ¬ &seq %tmpbuffer "" set %pagetitle %tmpbuffer !endif insert-string "~n~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string "~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string " ~n" insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" insert-string &cat %pagetitle "~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "

    ~n" insert-string "~n~n" execute-macro-13 insert-string "~n~n" insert-string "~n~n" !endm 34 store-macro set %noop 1 !endm 35 store-macro set %noop 1 !endm 36 store-macro set %noop 1 !endm ;################################################################ 37 store-macro ; end-long insert-string "~n~n~n" insert-string "~n~n" insert-string "~n" insert-string "~n~n" execute-macro-13 insert-string "~n~n" execute-macro-38 insert-string "~n~n" execute-macro-39 !endm 38 store-macro ; page-info set %curcol $curcol set %question &cat &cat "Page Contact Name? (" %author ") " set %contactname @%question !if &seq %contactname "" set %contactname %author !endif set %question &cat &cat "Page Contact e-mail address? (" %email ") " set %contactemail @%question !if &seq %contactemail "" set %contactemail %email !endif insert-string "

    ~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "For information regarding this page, contact " insert-string "" insert-string %contactname insert-string " (" insert-string %contactemail insert-string ")" %curcol insert-string " " insert-string "~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "

    ~n" !endm 39 store-macro ; end-short insert-string "~n" insert-string "~n" !endm 40 store-macro !if &equ %htmlhelp 0 set %curbuf $cbufname select-buffer "[HTML Help]" set %htmlhelp 1 !else select-buffer %curbuf set %htmlhelp 0 write-message "Press Meta-H for HELP buffer" !endif !endm store-procedure divline insert-string "================================================================~n" !endm store-procedure headsection insert-string "~n~n" insert-string "~n" insert-string "~n" insert-string "~n" insert-string "~n" insert-string "~n" insert-string "" insert-string %pagetitle insert-string "~n" insert-string "~n" !if &equ %htmljava 1 insert-string "~n~n" insert-string "~n" insert-string "~n~n" !endif insert-string "~n" insert-string "~n~n" !endm store-procedure bodysection insert-string "~n" insert-string "~n" insert-string "~n" insert-string "~n~n" insert-string "~n~n" insert-string "~n~n" !endm store-procedure centerstart ; %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "

    ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string " ~n" set %curcol &add %curcol 16 %curcol insert-string " " !endm store-procedure centerend set %curcol &sub %curcol 16 %curcol insert-string " " insert-string " ~n" %curcol insert-string " " insert-string "
    ~n" %curcol insert-string " " insert-string "
    ~n" !endm store-procedure mkframes set %orient @"Columns w/ Rows or Rows w/ Columns (C/R)? " !if &or &seq %orient "C" &seq %orient "c" set %cols @"Frames: How many columns? " !if &seq %cols "" set %cols 1 !endif set %cpercent &div 100 %cols insert-string "~n" update-screen set %fcnt 0 set %icnt 0 !while &les %icnt %cols set %icnt &add %icnt 1 set %question &cat &cat "How many rows in column " %icnt " (1)? " set %subrows @%question !if &seq %subrows "" set %subrows 1 !endif !if &gre %subrows 1 set %rpercent &div 100 %subrows insert-string " ~n" update-screen !endif set %jcnt 0 !while &les %jcnt %subrows set %fcnt &add %fcnt 1 set %jcnt &add %jcnt 1 insert-string " ~n" update-screen !endwhile !if &gre %subrows 1 insert-string " ~n" !endif !endwhile insert-string "~n" !else set %rows @"Frames: How many rows? " !if &seq %rows "" set %rows 1 !endif set %rpercent &div 100 %rows insert-string "~n" update-screen set %fcnt 0 set %icnt 0 !while &les %icnt %rows set %icnt &add %icnt 1 set %question &cat &cat "How many columns in row " %icnt " (1)? " set %subcols @%question !if &seq %subcols "" set %subcols 1 !endif !if &gre %subcols 1 set %cpercent &div 100 %subcols insert-string " ~n" update-screen !endif set %jcnt 0 !while &les %jcnt %subcols set %fcnt &add %fcnt 1 set %jcnt &add %jcnt 1 insert-string " ~n" update-screen !endwhile !if &gre %subcols 1 insert-string " ~n" !endif !endwhile insert-string "~n" !endif !endm bind-to-key execute-macro-1 ^X1 bind-to-key execute-macro-2 ^X! bind-to-key execute-macro-5 ^X2 bind-to-key execute-macro-6 ^X@ bind-to-key execute-macro-9 ^X3 bind-to-key execute-macro-10 ^X# bind-to-key execute-macro-13 ^X4 bind-to-key execute-macro-14 ^X$ bind-to-key execute-macro-17 ^X5 bind-to-key execute-macro-18 ^X% bind-to-key execute-macro-21 ^X6 bind-to-key execute-macro-22 ^X^ bind-to-key execute-macro-29 ^X7 bind-to-key execute-macro-30 ^X& bind-to-key execute-macro-33 ^X9 bind-to-key execute-macro-37 ^X0 bind-to-key execute-macro-1 FN1 bind-to-key execute-macro-2 S-FN1 bind-to-key execute-macro-5 FN2 bind-to-key execute-macro-6 S-FN2 bind-to-key execute-macro-9 FN3 bind-to-key execute-macro-10 S-FN3 bind-to-key execute-macro-13 FN4 bind-to-key execute-macro-14 S-FN4 bind-to-key execute-macro-17 FN5 bind-to-key execute-macro-18 S-FN5 bind-to-key execute-macro-21 FN6 bind-to-key execute-macro-22 S-FN6 bind-to-key execute-macro-29 FN7 bind-to-key execute-macro-30 S-FN7 bind-to-key execute-macro-33 FN9 bind-to-key execute-macro-37 FN0 bind-to-key execute-macro-40 M-H set %curbuf $cbufname select-buffer "[HTML Help]" insert-string "Press Meta-H to return to previous buffer~n" insert-string "Detailed Documentation for this macro at the following URL:~n" insert-string " http://members.xoom.com/uemacs/htmlgen.html~n~n" insert-string "^X represents a Control-X~n" insert-string "A Control-X is when you hold down the control key and press the X key.~n" execute-procedure divline insert-string "Start an HTML document~n" insert-string " ^X-1 or F1 Generic HTML Header with javascript~n" insert-string " ^X-! or Shift-F1 Import HTML Header File~n" execute-procedure divline insert-string "Start an HTML Frames Document~n" insert-string " ^X-2 or F2 Generic HTML Frame Page~n" insert-string " ^X-@ or Shift-F2 Import HTML Frame Header file~n" execute-procedure divline insert-string "Headers~n" insert-string " ^X-3 or F3 Standard HTML Header tag~n" insert-string " ^X-# or Shift-F3 Header using FONT and BOLD tags~n" execute-procedure divline insert-string "Horizontal Rules~n" insert-string " ^X-4 or F4 Horizontal Rule using a table~n" insert-string " ^X-$ or Shift-F4 Standard Horizontal Rule~n" execute-procedure divline insert-string "Tables~n" insert-string " ^X-5 or F5 Table with caption, header, and data sections~n" insert-string " ^X-% or Shift-F5 Table with data section only~n" execute-procedure divline insert-string "Lists~n" insert-string " ^X-6 or F6 Ordered/Unordered List~n" insert-string " ^X-^ or Shift-F6 Definition List~n" execute-procedure divline insert-string "Import a File~n" insert-string " ^X-7 or F7 Import a file~n" insert-string " ^X-& or Shift-F7 Import a Preformatted file~n" execute-procedure divline insert-string "Title Bars~n" insert-string " ^X-9 or F9 Insert Tri-segmented Title Bar~n" execute-procedure divline insert-string "End an Html Document~n" insert-string " ^X-0 or F10 Long version with contact info~n" execute-procedure divline beginning-of-file unmark-buffer add-mode "view" select-buffer %curbuf write-message "Press Meta-H for HELP buffer"