From ad3b8987c490fcb2d7e1dffa878e3710f2b2f373 Mon Sep 17 00:00:00 2001 From: crc Date: Tue, 16 Apr 2019 18:18:17 +0000 Subject: [PATCH] example: exporting of all samples now uses a more easily configured path FossilOrigin-Name: 9467b600c6b6112d385bec36c199991051f09f27eb99bc6cbb2d99acb5373f4c --- example/publish-examples.forth | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/example/publish-examples.forth b/example/publish-examples.forth index 634bfa4..d414e60 100755 --- a/example/publish-examples.forth +++ b/example/publish-examples.forth @@ -4,6 +4,12 @@ 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 +~~~ + ~~~ :unix:count-files (-n) 'ls_-1_|_wc_-l file:R unix:popen @@ -22,7 +28,7 @@ are stored in `/home/crc/public/examples`. # Generate index.html ~~~ -'/home/crc/public/examples/index.html file:W file:open 'FID const +FILE-PATH 'index.html s:append file:W file:open 'FID const :index:put [ FID file:write ] s:for-each ; @@ -42,8 +48,8 @@ FID file:close # Generate HTML Files ~~~ -:export dup './export-as-html.forth_%s_>/home/crc/public/examples/%s.html - s:format unix:system $. c:put ; +: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 ~~~