@@ -13,23 +13,36 @@ exec racket -f $0
1313 (aload " arc.arc" )
1414 (aload " libs.arc" ))
1515
16- (system " rm -rf html" )
16+ (define-syntax-rule (arc-do body ...)
17+ (arc-eval ' (do body ...)))
1718
18- (system " rm -rf inserts.sql" )
1919
20- (arc-eval ' (do
21- (w/outfile sql "inserts.sql"
22- (w/stdout sql
23- (prn "CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);")
24- (prn "CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);")))
20+ ; Build the ref/ directory. It will be served by GitHub pages.
21+
22+ (system "rm -rf html")
23+
24+ (arc-do
2525 (ensure-dir "html")
2626 (declare ' atstrings nil)
2727 (load " template.arc" )
2828 (runall)
29- (run " foundation-doc.tem" )))
29+ (run " foundation-doc.tem" ))
3030(system " cp docs/* html/* ../ref" )
3131(system " rm -rf html" )
3232
33+
34+ ; Based on the ref/ directory we just built, build an arc.docset/
35+ ; directory in a format Dash can browse as offline documentation
36+ ; (https://kapeli.com/dash).
37+
38+ (system " rm -rf inserts.sql" )
39+
40+ (arc-do
41+ (w/outfile sql " inserts.sql"
42+ (w/stdout sql
43+ (prn " CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);" )
44+ (prn " CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);" ))))
45+
3346(system " rm -fr ../arc.docset/Contents/Resources/Documents/html" )
3447(system " cp -r ../ref ../arc.docset/Contents/Resources/Documents/html" )
3548;; cut navigation toolbar because it is unnecessary in Dash
0 commit comments