#!/usr/bin/env retro This tool is intended to be used to create an HTML version of the standard documentation. Our structure will look like: Book Root Directory |-- index.html |-- chapters/... Begin by defining some helper functions for writing to a file. ~~~ 'tools/book-chapters.retro include 'FID var :file:s:put [ @FID file:write ] s:for-each ; :file:nl ASCII:CR @FID file:write ; :unix:mkdir 'mkdir_-p_%s s:format unix:system ; ~~~ Create the directories needed. ~~~ 'Create_directories s:put nl { 'chapters 'chapters/building 'chapters/general 'chapters/internals 'chapters/tech-notes 'chapters/techniques 'chapters/toolchain 'chapters/toolchain/info 'chapters/toolchain/man 'html } [ dup tab s:put nl unix:mkdir ] a:for-each ~~~ # Create the Index file ~~~ 'Generate_`index.html` s:put nl 'html/index.html file:open-for-writing !FID { ' '
'____