#!/usr/bin/env retro This program generates an HTML index and exports (using the `export-as-html.forth` example) the samples to HTML. The files are stored in `/home/crc/public/examples`. # Configuration ~~~ '/home/crc/public/examples/ 'FILE-PATH s:const ~~~ # Variables ~~~ 'FID var ~~~ # Support This word takes a string and provides a flag of `TRUE` if it ends in `/`, or `FALSE` otherwise. It leaves the string pointer on the stack. ~~~ :dir? (s-sf) dup s:length over + n:dec fetch $/ eq? ; ~~~ # Words To Create The Index ~~~ :s:put [ @FID file:write ] s:for-each ; :css ' s:put ; :dtd ' s:put ; :title 'RETRO_Examples s:put ; :head ' s:put title css ' s:put ; :li '
  • s:put call '

  • \n s:format s:put ; :link dup '%s_ s:format s:put ; :link2 '
    →_glossary s:format s:put $. c:put ; :links [ dup link link2 ] li ; :body ' s:put call ' s:put ; :make dtd head body ; ~~~ # Generate index.html ~~~ FILE-PATH 'index.html s:append file:W file:open !FID [ '

    Examples


    s:put nl ] make @FID file:close ~~~ # Generate HTML Files ~~~ :export FILE-PATH over './export-as-html.forth_%s_>%s%s.html s:format unix:system $. c:put ; [ dir? &drop [ export ] choose ] unix:for-each-file nl ~~~ # Generate a Glossary File For Each ~~~ :glossary FILE-PATH over 'retro-document_%s_>%s%s.glossary s:format unix:system $. c:put ; [ dir? &drop &glossary choose ] unix:for-each-file ~~~