-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.cene
145 lines (119 loc) · 4.67 KB
/
demo.cene
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
\= demo.cene (part of Mise-en.cene)
\= Copyright 2017, 2021 Rocketnia. Released under the MIT License.
\= ===== Miscellaneous utilities =====================================
(defn convo-list list
(doc-node (list /doc-attr-html-tag str.ul)
/istring-from-list/map list /fn item
(doc-node (list /doc-attr-html-tag str.li) /istring-done item)))
\= ===== Build artifact: The demo's JavaScript behavior ==============
(defn js-client-main client
(then-js-effects
(run-give-unwrapped-js-effects client
js.\;qq;yp[return function ( client ) {
var document = client.getTopLevelVar( "document" );
return client.done( client.wrap( document.body ) );
};])
/fn body
\= TODO: Move the definition of `convo-main` above this use site.
/let doc (convo-list/convo-main/nil)
/later-js-effects/fn js-effects-definer
/html-data-from-convo-tags-later doc /fn doc
/definer-define js-effects-definer (dex-give-up/nil)
/run-js-builder client
/dom-transform done-js-builder.body /list/domt-from-doc-node doc))
(def-macro build-client
home-scope caller-scope my-stx-details args then
(basic-nil-macro home-scope caller-scope my-stx-details then
/fn caller-scope s mac
/get-mode/fn mode
/join-effects
(make-js-program mode home-scope
(output-path-get
(output-path-get cli-output-directory.mode str.\;qq[demo])
str.\;qq[client.js])
str.js-client-main
/list str.document)
/no-effects/nil))
(build-client)
\= ===== Build artifact: Raw assets the demo uses ====================
(def-macro build-raw-assets
home-scope caller-scope my-stx-details args then
(basic-nil-macro home-scope caller-scope my-stx-details then
/fn caller-scope s mac
/get-mode/fn mode
/join-effects
(copy-paths mode
(input-path-get
(input-path-get cli-input-directory.mode str.src)
str.raw)
cli-output-directory.mode)
/no-effects/nil))
(build-raw-assets)
\= ===== Demo screenplay =============================================
\= This dialogue is derived from Rick and Rollo volume 18, a public
\= domain comic obtained from these URLs:
\=
\= https://digitalcomicmuseum.com/preview/index.php?did=23823&page=15
\= to
\= https://digitalcomicmuseum.com/preview/index.php?did=23823&page=19
(defn convo-main -
/let rollo (convo-tag str.rollo)
/let greg (convo-tag str.greg)
/let rock (convo-tag str.rock)
/let police (convo-tag str.police)
/let sfx (convo-tag str.sfx)
/let title (convo-tag str.title)
/let sad (convo-tag str.sad)
/let happy (convo-tag str.happy)
/let distressed (convo-tag str.distressed)
/let shocked (convo-tag str.shocked)
/convo-lines \;qq;yp/
\= TODO: Implement some way to allow us to wrap long lines like this
\= one. A good solution would be to implement ;in syntax in the Cene
\= reader. A much prettier solution would be for `convo-lines` to look
\= for lines without | and combine them with the previous lines, with
\= a space in between. Maybe we could redesign the `convo-lines`
\= syntax to have a delimiter between lines, so that we don't need
\= whitespace preservation in the first place.
\=
rollo | Mother may disapprove if she finds you wearing all those gems, Rock!
rock | Aw, she won't mind!
rock distressed | This is some load...
rock distressed | All these imitation jewels are...
rollo | Those jewels are...
greg | Heh! Heh! Just a couple of brats!
greg | You know what this is?
rock shocked | Any stupe knows that's a gun!
rock | You simply shouldn't point guns at people!
sfx | WAK
greg sad | Ouch!
greg sad | It's only a play gun! Please let me have it back!
rock distressed | I hate to see a crook blubber! Here's your gun!
greg | As a matter of fact, this is a real gun! Hee!
greg | That's mighty nice looking ice you're wearing! Let's have it!
rock | Why sure... if you insist! You've got the gun!
greg | You have any more?
rock | Wait right here!
greg | No, I'll come along!
rollo | Mother won't like this!
greg | Hand it [b all] over!
rock | That's what I'm doing!
greg distressed | H-hey that's about enough!
rock | Oh, [b do] have some more!
rock | You [b want] it all, you'll [b get] it all!
sfx | CRASH
rock | You're [b loaded]! Tee hee!
rollo happy | I'll call the police!
rock shocked | Tell them to bring an ambulance!
police shocked | It's [b Greedy Greg], the jewel thief!
rock | So I kept piling this imitation jewelry on him till he collaped!
police happy | Good work, girl! You'll be rewarded!
rollo | Mother will be upset!
rock distressed | She'd be more upset if they took all that imitation jewelry!
rollo | That's what I'm trying to tell you...
rock shocked | What?
rollo | That was [b real] jewelry! Worth [b millions]!
rollo shocked | [b Real] jewelry? Gasp!
sfx | PLOP!
title | The [b End]
)