/** * Generate appCache Manifest file here */ exports.appCache = appCache; var fs = require('q-fs'); var Q = require('qq'); function identity($) {return $;} function appCache(path) { if(!path) { return appCacheTemplate(); } var blackList = ["build/docs/offline.html", "build/docs/sitemap.xml", "build/docs/robots.txt", "build/docs/docs-scenario.html", "build/docs/docs-scenario.js", "build/docs/appcache.manifest", "build/docs/.htaccess" ]; var result = ["CACHE MANIFEST", "# " + new Date().toISOString(), "", "# cache all of these", "CACHE:", "../angular.min.js"]; var resultPostfix = ["", "FALLBACK:", "/offline.html", "", "# allow access to google analytics and twitter when we are online", "NETWORK:", "*"]; var promise = fs.listTree(path).then(function(files){ var fileFutures = []; files.forEach(function(file){ fileFutures.push(fs.isFile(file).then(function(isFile){ if (isFile && blackList.indexOf(file) == -1) { return file.replace('build/docs/',''); } })); }); return Q.deep(fileFutures); }).then(function(files){ return result.concat(files.filter(identity)).concat(resultPostfix).join('\n'); }); return promise; } function appCacheTemplate() { return ["CACHE MANIFEST", "# " + new Date().toISOString(), "", "# cache all of these", "CACHE:", "syntaxhighlighter/syntaxhighlighter-combined.js", "../angular.min.js", "docs-combined.js", "docs-keywords.js", "docs-combined.css", "syntaxhighlighter/syntaxhighlighter-combined.css", "img/texture_1.png", "img/yellow_bkgnd.jpg", "", "FALLBACK:", "/ offline.html", "", "# allow access to google analytics and twitter when we are online", "NETWORK:", "*"].join('\n'); } ep'>log msg
path: root/docs/src/gen-docs.js
blob: 61fd3b3a6e9e23f746da8363b806f2b93f936909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139