forked from Jermolene/build.jermolene.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bld.sh
executable file
·285 lines (238 loc) · 9.34 KB
/
bld.sh
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#!/bin/bash
# Build all tiddlywiki.com assets using the version of tiddlywiki specified in package.json
# Default to the current version
if [ -z "$TW5_BUILD_VERSION" ]; then
TW5_BUILD_VERSION=v5.1.15
fi
# Default to using tw5.com as the main edition
if [ -z "$TW5_BUILD_MAIN_EDITION" ]; then
TW5_BUILD_MAIN_EDITION=../TiddlyWiki5/editions/tw5.com
fi
# Default to the version of TiddlyWiki installed in this repo
if [ -z "$TW5_BUILD_TIDDLYWIKI" ]; then
TW5_BUILD_TIDDLYWIKI=../build.jermolene.github.io/node_modules/tiddlywiki/tiddlywiki.js
fi
# Set up the build output directory
if [ -z "$TW5_BUILD_OUTPUT" ]; then
TW5_BUILD_OUTPUT=../jermolene.github.io
fi
if [ ! -d "$TW5_BUILD_OUTPUT" ]; then
echo 'A valid TW5_BUILD_OUTPUT environment variable must be set'
exit 1
fi
echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
# Make the CNAME file that GitHub Pages requires
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
# Delete any existing static content
mkdir -p $TW5_BUILD_OUTPUT/static
mkdir -p $TW5_BUILD_OUTPUT/dev
mkdir -p $TW5_BUILD_OUTPUT/dev/static
rm $TW5_BUILD_OUTPUT/static/*
rm $TW5_BUILD_OUTPUT/dev/static/*
# Redirects
echo "<a href='./plugins/tiddlywiki/tw2parser/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/tw2parser/index.html</a>" > $TW5_BUILD_OUTPUT/classicparserdemo.html
echo "<a href='./plugins/tiddlywiki/codemirror/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/codemirror/index.html</a>" > $TW5_BUILD_OUTPUT/codemirrordemo.html
echo "<a href='./plugins/tiddlywiki/d3/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/d3/index.html</a>" > $TW5_BUILD_OUTPUT/d3demo.html
echo "<a href='./plugins/tiddlywiki/highlight/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/highlight/index.html</a>" > $TW5_BUILD_OUTPUT/highlightdemo.html
echo "<a href='./plugins/tiddlywiki/markdown/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/markdown/index.html</a>" > $TW5_BUILD_OUTPUT/markdowndemo.html
echo "<a href='./plugins/tiddlywiki/tahoelafs/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/tahoelafs/index.html</a>" > $TW5_BUILD_OUTPUT/tahoelafs.html
######################################################
#
# Core distribution
#
######################################################
# /index.html Main site
# /favicon.ico Favicon for main site
# /empty.html Empty
# /empty.hta For Internet Explorer
# /static.html Static rendering of default tiddlers
# /alltiddlers.html Static rendering of all tiddlers
# /static/* Static single tiddlers
# /static/static.css Static stylesheet
# /static/favicon.ico Favicon for static pages
node $TW5_BUILD_TIDDLYWIKI \
$TW5_BUILD_MAIN_EDITION \
--verbose \
--output $TW5_BUILD_OUTPUT \
--build favicon empty static index \
|| exit 1
# /dev/index.html Developer docs
# /dev/favicon.ico Favicon for dev site
# /dev/static.html Static rendering of default tiddlers
# /dev/alltiddlers.html Static rendering of all tiddlers
# /dev/static/* Static single tiddlers
# /dev/static/static.css Static stylesheet
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/dev \
--verbose \
--output $TW5_BUILD_OUTPUT/dev \
--build index favicon static \
|| exit 1
# /upgrade.html Custom edition for performing upgrades
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/upgrade \
--verbose \
--output $TW5_BUILD_OUTPUT \
--build upgrade \
|| exit 1
# /encrypted.html Copy of the main file encrypted with the password "password"
node $TW5_BUILD_TIDDLYWIKI \
$TW5_BUILD_MAIN_EDITION \
--verbose \
--output $TW5_BUILD_OUTPUT \
--build encrypted \
|| exit 1
######################################################
#
# Editions
#
######################################################
# /editions/xlsx-utils/index.html xlsx-utils edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/xlsx-utils \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \
--build index \
|| exit 1
# /editions/resumebuilder/index.html Resume builder edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/resumebuilder \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/resumebuilder/ \
--build index \
|| exit 1
# /editions/text-slicer/index.html Text slicer edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/text-slicer \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/text-slicer/ \
--build index \
|| exit 1
# /editions/translators/index.html Translators edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/translators \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/translators/ \
--build index \
|| exit 1
# /editions/introduction/index.html Introduction edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/introduction \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/introduction/ \
--build index \
|| exit 1
# /editions/full/index.html Full edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/full \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/full/ \
--build index \
|| exit 1
# /editions/tw5.com-docs/index.html tiddlywiki.com docs edition
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/tw5.com-docs \
--verbose \
--output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \
--build index \
|| exit 1
######################################################
#
# Plugin demos
#
######################################################
# /plugins/tiddlywiki/katex/index.html Demo wiki with KaTeX plugin
# /plugins/tiddlywiki/katex/empty.html Empty wiki with KaTeX plugin
# TODO: Build the static file with the release of 5.1.3
# --rendertiddler $:/core/templates/static.template.html plugins/tiddlywiki/katex/static.html text/plain \
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/katexdemo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/katex/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/tahoelafs/index.html Demo wiki with Tahoe-LAFS plugin
# /plugins/tiddlywiki/tahoelafs/empty.html Empty wiki with Tahoe-LAFS plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/tahoelafs \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/tahoelafs/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/tahoelafs/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/d3/index.html Demo wiki with D3 plugin
# /plugins/tiddlywiki/d3/empty.html Empty wiki with D3 plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/d3demo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/d3/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/d3/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/codemirror/index.html Demo wiki with codemirror plugin
# /plugins/tiddlywiki/codemirror/empty.html Empty wiki with codemirror plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/codemirrordemo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/codemirror/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/markdown/index.html Demo wiki with Markdown plugin
# /plugins/tiddlywiki/markdown/empty.html Empty wiki with Markdown plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/markdowndemo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/markdown/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/tw2parser/index.html Demo wiki with tw2parser plugin
# /plugins/tiddlywiki/tw2parser/empty.html Empty wiki with tw2parser plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/classicparserdemo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/tw2parser/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/highlight/index.html Demo wiki with highlight plugin
# /plugins/tiddlywiki/highlight/empty.html Empty wiki with highlight plugin
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/highlightdemo \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|| exit 1
######################################################
#
# Language editions
#
######################################################
../build.jermolene.github.io/languages-bld.sh
######################################################
#
# Plugin library
#
######################################################
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/pluginlibrary \
--verbose \
--output $TW5_BUILD_OUTPUT/library/$TW5_BUILD_VERSION \
--build \
|| exit 1
######################################################
#
# Tests
#
######################################################
# /test.html Wiki for running tests in browser
# Also runs the serverside tests
node $TW5_BUILD_TIDDLYWIKI \
../TiddlyWiki5/editions/test \
--verbose \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all test.html text/plain \
|| exit 1