Skip to content

Commit 16a4081

Browse files
committed
Script generations was changed to build docset for Dash if sqlite3 is found.
1 parent 0b27897 commit 16a4081

File tree

8 files changed

+60
-4
lines changed

8 files changed

+60
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
_site
2+
/arc.docset/Contents/Resources/docSet.dsidx
3+
/arc.docset/Contents/Resources/Documents/html

_ref/docs/hdr2.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<li><a href="http://arclanguage.org/forum">Forum</a></li>
1818
</ul>
1919
</div>
20-
</div>
20+
</div> <!-- end of navbar -->
2121
%%LINKS%%
2222
<h1 class="links">%%TITLE%%</h1>

_ref/docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<li><a href="http://arclanguage.org/forum">Forum</a></li>
1818
</ul>
1919
</div>
20-
</div>
20+
</div> <!-- end of navbar -->
2121

2222
<div class="links"></div>
2323
<h1 class="links">Table of Contents</h1>

_ref/generate.sh

+16
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,27 @@ exec racket -f $0
1414
(aload "libs.arc"))
1515

1616
(system "rm -rf html")
17+
18+
(system "rm -rf inserts.sql")
19+
1720
(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);")))
1825
(ensure-dir "html")
1926
(declare 'atstrings nil)
2027
(load "template.arc")
2128
(runall)
2229
(run "foundation-doc.tem")))
2330
(system "cp docs/* html/* ../ref")
2431
(system "rm -rf html")
32+
33+
(system "rm -fr ../arc.docset/Contents/Resources/Documents/html")
34+
(system "cp -r ../ref ../arc.docset/Contents/Resources/Documents/html")
35+
;; cut navigation toolbar because it is unnecessary in Dash
36+
(system "sed -i '' '/navbar-inverse/,/end of navbar/d' ../arc.docset/Contents/Resources/Documents/html/*.html")
37+
38+
(system "rm -f ../arc.docset/Contents/Resources/docSet.dsidx")
39+
(system "which sqlite3 > /dev/null && cat inserts.sql | sqlite3 ../arc.docset/Contents/Resources/docSet.dsidx")
40+
(system "rm -f inserts.sql")

_ref/template.arc

+24-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
(with (tag nil tags nil operation nil arglist nil desc nil testlist nil)
9595
(push (pop args) tags)
9696
(= tag (pop args))
97+
9798
(while (in tag 'destructive 'predicate)
9899
(push tag tags)
99100
(= tag (pop args)))
@@ -105,13 +106,34 @@
105106
(prn " <tr>")
106107
(pr " <td class='arc'>")
107108
(add-anchor2 (coerce operation 'string))
108-
(if (intags 'mac tags) (prn "<img src='macro.gif' title='Macro'/>"))
109+
110+
(= op-type "Function")
111+
112+
(when (intags 'mac tags)
113+
(prn "<img src='macro.gif' title='Macro'/>")
114+
(= op-type "Macro"))
109115
(if (intags 'op tags) (prn "<img src='foundation.gif' title='Foundation'/>"))
110116
(if (intags 'def tags) (prn "<img src='proc.gif' title='Procedure'/>"))
111-
(if (intags 'var tags) (prn "<img src='var.gif' title='Variable'/>"))
117+
(when (intags 'var tags)
118+
(prn "<img src='var.gif' title='Variable'/>")
119+
(= op-type "Variable"))
112120
(if (intags 'destructive tags) (prn "<img src='destructive.gif' title='Destructive'/>"))
113121
(if (intags 'predicate tags) (prn "<img src='predicate.gif' title='Predicate'/>"))
114122

123+
124+
(w/appendfile sql "inserts.sql"
125+
(w/stdout sql (prn
126+
"INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES ('"
127+
operation
128+
"','"
129+
op-type
130+
"','"
131+
out-file-name*
132+
"#"
133+
(urlencode:string operation)
134+
"');")))
135+
136+
115137
(pr "<span class='op'>" operation "</span> ")
116138
(prn "<span class='args'>" arglist "</span>")
117139
(prn " <div class='desc'>" desc "</div>")

arc.docset/Contents/Info.plist

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleIdentifier</key>
6+
<string>arc</string>
7+
<key>CFBundleName</key>
8+
<string>Arc Lisp</string>
9+
<key>DocSetPlatformFamily</key>
10+
<string>arc</string>
11+
<key>isDashDocset</key>
12+
<true/>
13+
<key>dashIndexFilePath</key>
14+
<string>html/index.html</string>
15+
</dict>
16+
</plist>

arc.docset/Contents/Resources/Documents/.keep

Whitespace-only changes.

arc.docset/icon.png

14.7 KB
Loading

0 commit comments

Comments
 (0)