extwee 2.0.6 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +25 -25
- package/.github/FUNDING.yml +3 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/nodejs.yml +25 -24
- package/.travis.yml +13 -13
- package/CODE_OF_CONDUCT.md +82 -82
- package/LICENSE +21 -21
- package/README.md +173 -36
- package/SECURITY.md +12 -12
- package/babel.config.json +18 -22
- package/build/extwee +0 -0
- package/build/extwee.exe +0 -0
- package/build/extwee.web.min.js +2 -0
- package/build/extwee.web.min.js.LICENSE.txt +1 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +167 -0
- package/docs/_sidebar.md +19 -0
- package/docs/examples/dynamicPassages.md +28 -0
- package/docs/examples/jsonToTwee.md +23 -0
- package/docs/examples/twsToTwee.md +25 -0
- package/docs/formats/json.md +17 -0
- package/docs/formats/twee.md +13 -0
- package/docs/formats/twine1HTML.md +13 -0
- package/docs/formats/twine2ArchiveHTML.md +13 -0
- package/docs/formats/twine2HTML.md +13 -0
- package/docs/formats/tws.md +9 -0
- package/docs/index.html +26 -0
- package/docs/install/binaries.md +9 -0
- package/docs/install/npm.md +20 -0
- package/docs/install/npx.md +9 -0
- package/docs/objects/passage.md +47 -0
- package/docs/objects/story.md +70 -0
- package/docs/objects/storyformat.md +27 -0
- package/index.html +22 -0
- package/index.js +29 -31
- package/package.json +65 -58
- package/src/JSON/parse.js +128 -0
- package/src/Passage.js +298 -202
- package/src/Story.js +650 -523
- package/src/StoryFormat/parse.js +134 -0
- package/src/StoryFormat.js +259 -300
- package/src/TWS/parse.js +86 -0
- package/src/Twee/parse.js +157 -0
- package/src/Twine1HTML/compile.js +58 -0
- package/src/Twine1HTML/parse.js +134 -0
- package/src/Twine2ArchiveHTML/compile.js +36 -0
- package/src/Twine2ArchiveHTML/parse.js +49 -0
- package/src/Twine2HTML/compile.js +35 -0
- package/src/Twine2HTML/parse.js +348 -0
- package/src/extwee.js +206 -0
- package/test/CLI/CLI.test.js +49 -0
- package/test/CLI/files/example.json +1 -0
- package/test/CLI/files/example6.twee +22 -0
- package/test/{Roundtrip → CLI/files}/harlowe.js +2 -2
- package/test/CLI/{input.html → files/input.html} +47 -47
- package/test/CLI/files/output/test.twee +0 -0
- package/test/CLI/{tweeExample.twee → files/tweeExample.twee} +17 -17
- package/test/CLI/files/twine1/LICENSE.txt +32 -0
- package/test/CLI/files/twine1/code.js +5 -0
- package/test/CLI/files/twine1/engine.js +43 -0
- package/test/CLI/files/twine1/header.html +325 -0
- package/test/CLI/files/twine1Test.html +371 -0
- package/test/CLI/{twineExample.html → files/twineExample.html} +16 -15
- package/test/JSON/JSON.Parse.test.js +316 -0
- package/test/Passage.test.js +175 -104
- package/test/Roundtrip/{Example1.html → Files/Example1.html} +63 -63
- package/test/Roundtrip/Files/LICENSE +19 -0
- package/test/Roundtrip/Files/example1.twee +10 -0
- package/test/Roundtrip/{example2.twee → Files/example2.twee} +27 -18
- package/test/Roundtrip/{example4.twee → Files/example4.twee} +27 -27
- package/test/{StoryFormatParser → Roundtrip/Files}/harlowe.js +2 -2
- package/test/Roundtrip/{round.html → Files/round.html} +6 -4
- package/test/Roundtrip/Roundtrip.test.js +54 -0
- package/test/Story.test.js +638 -423
- package/test/StoryFormat/StoryFormat.Parse.test.js +91 -0
- package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/example.js +3 -3
- package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/example2.js +3 -3
- package/test/{CLI → StoryFormat/StoryFormatParser}/harlowe.js +2 -2
- package/test/StoryFormat.test.js +152 -152
- package/test/TWS/Parse.test.js +78 -0
- package/test/TWS/TWSParser/Example1.tws +150 -0
- package/test/TWS/TWSParser/Example5.tws +414 -0
- package/test/TWS/TWSParser/noscale.tws +0 -0
- package/test/TWS/TWSParser/nostory.tws +0 -0
- package/test/Twee/Twee.Parse.test.js +76 -0
- package/test/{TweeParser → Twee/TweeParser}/emptytags.twee +2 -2
- package/test/{TweeParser → Twee/TweeParser}/example.twee +32 -32
- package/test/{TweeParser → Twee/TweeParser}/missing.twee +19 -19
- package/test/{TweeParser → Twee/TweeParser}/multipleScriptPassages.twee +19 -19
- package/test/{TweeParser → Twee/TweeParser}/multipleStyleTag.twee +19 -19
- package/test/{TweeParser → Twee/TweeParser}/multipletags.twee +10 -10
- package/test/{TweeParser → Twee/TweeParser}/noTitle.twee +2 -2
- package/test/{TweeParser → Twee/TweeParser}/notes.twee +16 -16
- package/test/{TweeParser → Twee/TweeParser}/pasagemetadataerror.twee +2 -2
- package/test/{TweeParser → Twee/TweeParser}/scriptPassage.twee +16 -16
- package/test/{TweeParser → Twee/TweeParser}/singletag.twee +13 -13
- package/test/{TweeParser → Twee/TweeParser}/startMetadata.twee +14 -14
- package/test/{TweeParser → Twee/TweeParser}/storydataerror.twee +25 -25
- package/test/{TweeParser → Twee/TweeParser}/stylePassage.twee +16 -16
- package/test/{Story → Twee/TweeParser}/test.twee +25 -25
- package/test/Twine1HTML/Twine1HTML.Compile.test.js +180 -0
- package/test/Twine1HTML/Twine1HTML.Parse.test.js +183 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/LICENSE +674 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/engine.js +43 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/jquery.js +4 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/modernizr.js +4 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/engineTest.html +1 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/LICENSE +32 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/code.js +4 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/header.html +327 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test.html +0 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test1.html +6 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test2.html +6 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test3.html +43 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test4.html +372 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test5.html +372 -0
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Compile.test.js +35 -0
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Parse.test.js +25 -0
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTMLCompiler/test1.html +6 -0
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTMLParser/test1.html +3 -0
- package/test/Twine2HTML/Twine2HTML.Compile.test.js +224 -0
- package/test/Twine2HTML/Twine2HTML.Parse.test.js +172 -0
- package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/creator.html +4 -4
- package/test/{CLI → Twine2HTML/Twine2HTMLCompiler}/example6.twee +15 -15
- package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/missingStoryTitle.twee +29 -29
- package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/test2.html +10 -8
- package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/test3.html +1 -1
- package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/test4.html +4 -4
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/Example1.html +52 -52
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/Tags.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/lyingStartnode.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/lyingTagColors.html +48 -48
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingCreator.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingCreatorVersion.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingFormat.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingFormatVersion.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingIFID.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingName.html +33 -33
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingPID.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingPassageName.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingPassageTags.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingPosition.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingScript.html +14 -14
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingSize.html +35 -35
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingStartnode.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingStyle.html +14 -14
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/missingZoom.html +11 -11
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/twineExample.html +23 -23
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/twineExample2.html +15 -15
- package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/twineExample3.html +15 -15
- package/web-index.js +29 -0
- package/webpack.config.js +12 -0
- package/bin/extwee.js +0 -47
- package/src/FileReader.js +0 -33
- package/src/HTMLParser.js +0 -345
- package/src/HTMLWriter.js +0 -231
- package/src/StoryFormatParser.js +0 -142
- package/src/TweeParser.js +0 -161
- package/src/TweeWriter.js +0 -121
- package/story-formats/chapbook-1.2.0/format.js +0 -1
- package/story-formats/chapbook-1.2.0/logo.svg +0 -1
- package/story-formats/harlowe-1.2.4/format.js +0 -1
- package/story-formats/harlowe-1.2.4/icon.svg +0 -78
- package/story-formats/harlowe-2.1.0/format.js +0 -2
- package/story-formats/harlowe-2.1.0/icon.svg +0 -78
- package/story-formats/harlowe-3.1.0/format.js +0 -3
- package/story-formats/harlowe-3.1.0/icon.svg +0 -78
- package/story-formats/paperthin-1.0.0/format.js +0 -1
- package/story-formats/paperthin-1.0.0/icon.svg +0 -5
- package/story-formats/snowman-1.4.0/format.js +0 -1
- package/story-formats/snowman-1.4.0/icon.svg +0 -436
- package/story-formats/snowman-2.0.2/format.js +0 -1
- package/story-formats/snowman-2.0.2/icon.svg +0 -436
- package/story-formats/sugarcube-1.0.35/LICENSE +0 -23
- package/story-formats/sugarcube-1.0.35/format.js +0 -1
- package/story-formats/sugarcube-1.0.35/icon.svg +0 -56
- package/story-formats/sugarcube-2.31.1/LICENSE +0 -22
- package/story-formats/sugarcube-2.31.1/format.js +0 -1
- package/story-formats/sugarcube-2.31.1/icon.svg +0 -56
- package/test/CLI/test2.html +0 -45
- package/test/CLI.test.js +0 -30
- package/test/FileReader/t1.txt +0 -1
- package/test/FileReader.test.js +0 -14
- package/test/HTMLParser.test.js +0 -177
- package/test/HTMLWriter/example6.twee +0 -16
- package/test/HTMLWriter.test.js +0 -287
- package/test/Roundtrip/example1.twee +0 -21
- package/test/Roundtrip.test.js +0 -48
- package/test/Story/startmeta.twee +0 -29
- package/test/StoryFormatParser.test.js +0 -91
- package/test/TweeParser/test.twee +0 -25
- package/test/TweeParser.test.js +0 -79
- package/test/TweeWriter/test1.twee +0 -18
- package/test/TweeWriter/test3.twee +0 -12
- package/test/TweeWriter/test4.twee +0 -14
- package/test/TweeWriter/test5.twee +0 -20
- package/test/TweeWriter/test6.twee +0 -15
- package/test/TweeWriter/test7.twee +0 -15
- package/test/TweeWriter.test.js +0 -107
- /package/test/CLI/{test.twee → files/test.twee} +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/format.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/format_doublename.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingAuthor.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingDescription.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingImage.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingLicense.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingName.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingProofing.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingSource.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingURL.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/missingVersion.js +0 -0
- /package/test/{StoryFormatParser → StoryFormat/StoryFormatParser}/versionWrong.js +0 -0
- /package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/TestTags.html +0 -0
- /package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/test11.html +0 -0
- /package/test/{HTMLWriter → Twine2HTML/Twine2HTMLCompiler}/test6.html +0 -0
- /package/test/{HTMLParser → Twine2HTML/Twine2HTMLParser}/tagColors.html +0 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
(dp0
|
|
2
|
+
S'buildDestination'
|
|
3
|
+
p1
|
|
4
|
+
V\u005c\u005cMac\u005cDropbox\u005cTwineBuild.html
|
|
5
|
+
p2
|
|
6
|
+
sS'saveDestination'
|
|
7
|
+
p3
|
|
8
|
+
V\u005c\u005cMac\u005cDropbox\u005cExample5.tws
|
|
9
|
+
p4
|
|
10
|
+
sS'metadata'
|
|
11
|
+
p5
|
|
12
|
+
(dp6
|
|
13
|
+
S'description'
|
|
14
|
+
p7
|
|
15
|
+
Vtest1
|
|
16
|
+
p8
|
|
17
|
+
sS'identity'
|
|
18
|
+
p9
|
|
19
|
+
Vtest1
|
|
20
|
+
p10
|
|
21
|
+
ssS'target'
|
|
22
|
+
p11
|
|
23
|
+
S'sugarcane'
|
|
24
|
+
p12
|
|
25
|
+
sS'storyPanel'
|
|
26
|
+
p13
|
|
27
|
+
(dp14
|
|
28
|
+
S'widgets'
|
|
29
|
+
p15
|
|
30
|
+
(lp16
|
|
31
|
+
(dp17
|
|
32
|
+
S'selected'
|
|
33
|
+
p18
|
|
34
|
+
I00
|
|
35
|
+
sS'pos'
|
|
36
|
+
p19
|
|
37
|
+
(lp20
|
|
38
|
+
I10
|
|
39
|
+
aI10
|
|
40
|
+
asS'passage'
|
|
41
|
+
p21
|
|
42
|
+
(itiddlywiki
|
|
43
|
+
Tiddler
|
|
44
|
+
p22
|
|
45
|
+
(dp24
|
|
46
|
+
S'text'
|
|
47
|
+
p25
|
|
48
|
+
S'Your story will display this passage first. Edit it by double clicking it.'
|
|
49
|
+
p26
|
|
50
|
+
sS'title'
|
|
51
|
+
p27
|
|
52
|
+
S'Start'
|
|
53
|
+
p28
|
|
54
|
+
sS'modified'
|
|
55
|
+
p29
|
|
56
|
+
ctime
|
|
57
|
+
struct_time
|
|
58
|
+
p30
|
|
59
|
+
((I2023
|
|
60
|
+
I9
|
|
61
|
+
I3
|
|
62
|
+
I14
|
|
63
|
+
I38
|
|
64
|
+
I52
|
|
65
|
+
I6
|
|
66
|
+
I246
|
|
67
|
+
I1
|
|
68
|
+
tp31
|
|
69
|
+
(dp32
|
|
70
|
+
tp33
|
|
71
|
+
Rp34
|
|
72
|
+
sS'tags'
|
|
73
|
+
p35
|
|
74
|
+
(lp36
|
|
75
|
+
sS'created'
|
|
76
|
+
p37
|
|
77
|
+
g34
|
|
78
|
+
sbsa(dp38
|
|
79
|
+
g18
|
|
80
|
+
I00
|
|
81
|
+
sg19
|
|
82
|
+
(lp39
|
|
83
|
+
I10
|
|
84
|
+
aI150
|
|
85
|
+
asg21
|
|
86
|
+
(itiddlywiki
|
|
87
|
+
Tiddler
|
|
88
|
+
p40
|
|
89
|
+
(dp41
|
|
90
|
+
g25
|
|
91
|
+
S'Untitled Story'
|
|
92
|
+
p42
|
|
93
|
+
sg27
|
|
94
|
+
S'StoryTitle'
|
|
95
|
+
p43
|
|
96
|
+
sg29
|
|
97
|
+
g30
|
|
98
|
+
((I2023
|
|
99
|
+
I9
|
|
100
|
+
I3
|
|
101
|
+
I14
|
|
102
|
+
I38
|
|
103
|
+
I52
|
|
104
|
+
I6
|
|
105
|
+
I246
|
|
106
|
+
I1
|
|
107
|
+
tp44
|
|
108
|
+
(dp45
|
|
109
|
+
tp46
|
|
110
|
+
Rp47
|
|
111
|
+
sg35
|
|
112
|
+
(lp48
|
|
113
|
+
sg37
|
|
114
|
+
g47
|
|
115
|
+
sbsa(dp49
|
|
116
|
+
g18
|
|
117
|
+
I00
|
|
118
|
+
sg19
|
|
119
|
+
(lp50
|
|
120
|
+
I10
|
|
121
|
+
aI290
|
|
122
|
+
asg21
|
|
123
|
+
(itiddlywiki
|
|
124
|
+
Tiddler
|
|
125
|
+
p51
|
|
126
|
+
(dp52
|
|
127
|
+
g25
|
|
128
|
+
S'Anonymous'
|
|
129
|
+
p53
|
|
130
|
+
sg27
|
|
131
|
+
S'StoryAuthor'
|
|
132
|
+
p54
|
|
133
|
+
sg29
|
|
134
|
+
g30
|
|
135
|
+
((I2023
|
|
136
|
+
I9
|
|
137
|
+
I3
|
|
138
|
+
I14
|
|
139
|
+
I38
|
|
140
|
+
I52
|
|
141
|
+
I6
|
|
142
|
+
I246
|
|
143
|
+
I1
|
|
144
|
+
tp55
|
|
145
|
+
(dp56
|
|
146
|
+
tp57
|
|
147
|
+
Rp58
|
|
148
|
+
sg35
|
|
149
|
+
(lp59
|
|
150
|
+
sg37
|
|
151
|
+
g58
|
|
152
|
+
sbsa(dp60
|
|
153
|
+
g18
|
|
154
|
+
I01
|
|
155
|
+
sg19
|
|
156
|
+
(lp61
|
|
157
|
+
F262.0
|
|
158
|
+
aF10.0
|
|
159
|
+
asg21
|
|
160
|
+
(itiddlywiki
|
|
161
|
+
Tiddler
|
|
162
|
+
p62
|
|
163
|
+
(dp63
|
|
164
|
+
g25
|
|
165
|
+
V[[Untitled Passage 2]]
|
|
166
|
+
p64
|
|
167
|
+
sg27
|
|
168
|
+
VUntitled Passage 1
|
|
169
|
+
p65
|
|
170
|
+
sg29
|
|
171
|
+
g30
|
|
172
|
+
((I2023
|
|
173
|
+
I9
|
|
174
|
+
I3
|
|
175
|
+
I15
|
|
176
|
+
I47
|
|
177
|
+
I59
|
|
178
|
+
I6
|
|
179
|
+
I246
|
|
180
|
+
I1
|
|
181
|
+
tp66
|
|
182
|
+
(dp67
|
|
183
|
+
tp68
|
|
184
|
+
Rp69
|
|
185
|
+
sg35
|
|
186
|
+
(lp70
|
|
187
|
+
Vtag1
|
|
188
|
+
p71
|
|
189
|
+
aVtag2
|
|
190
|
+
p72
|
|
191
|
+
aVtag3
|
|
192
|
+
p73
|
|
193
|
+
asg37
|
|
194
|
+
g30
|
|
195
|
+
((I2023
|
|
196
|
+
I9
|
|
197
|
+
I3
|
|
198
|
+
I14
|
|
199
|
+
I39
|
|
200
|
+
I28
|
|
201
|
+
I6
|
|
202
|
+
I246
|
|
203
|
+
I1
|
|
204
|
+
tp74
|
|
205
|
+
(dp75
|
|
206
|
+
tp76
|
|
207
|
+
Rp77
|
|
208
|
+
sbsa(dp78
|
|
209
|
+
g18
|
|
210
|
+
I00
|
|
211
|
+
sg19
|
|
212
|
+
(lp79
|
|
213
|
+
F261.0
|
|
214
|
+
aF150.0
|
|
215
|
+
asg21
|
|
216
|
+
(itiddlywiki
|
|
217
|
+
Tiddler
|
|
218
|
+
p80
|
|
219
|
+
(dp81
|
|
220
|
+
g25
|
|
221
|
+
Vdd
|
|
222
|
+
p82
|
|
223
|
+
sg27
|
|
224
|
+
VUntitled Passage 2
|
|
225
|
+
p83
|
|
226
|
+
sg29
|
|
227
|
+
g30
|
|
228
|
+
((I2023
|
|
229
|
+
I9
|
|
230
|
+
I3
|
|
231
|
+
I15
|
|
232
|
+
I42
|
|
233
|
+
I58
|
|
234
|
+
I6
|
|
235
|
+
I246
|
|
236
|
+
I1
|
|
237
|
+
tp84
|
|
238
|
+
(dp85
|
|
239
|
+
tp86
|
|
240
|
+
Rp87
|
|
241
|
+
sg35
|
|
242
|
+
(lp88
|
|
243
|
+
sg37
|
|
244
|
+
g30
|
|
245
|
+
((I2023
|
|
246
|
+
I9
|
|
247
|
+
I3
|
|
248
|
+
I14
|
|
249
|
+
I39
|
|
250
|
+
I30
|
|
251
|
+
I6
|
|
252
|
+
I246
|
|
253
|
+
I1
|
|
254
|
+
tp89
|
|
255
|
+
(dp90
|
|
256
|
+
tp91
|
|
257
|
+
Rp92
|
|
258
|
+
sbsa(dp93
|
|
259
|
+
g18
|
|
260
|
+
I00
|
|
261
|
+
sg19
|
|
262
|
+
(lp94
|
|
263
|
+
F262.0
|
|
264
|
+
aF290.0
|
|
265
|
+
asg21
|
|
266
|
+
(itiddlywiki
|
|
267
|
+
Tiddler
|
|
268
|
+
p95
|
|
269
|
+
(dp96
|
|
270
|
+
g25
|
|
271
|
+
Vdd
|
|
272
|
+
p97
|
|
273
|
+
sg27
|
|
274
|
+
VUntitled Passage 3
|
|
275
|
+
p98
|
|
276
|
+
sg29
|
|
277
|
+
g30
|
|
278
|
+
((I2023
|
|
279
|
+
I9
|
|
280
|
+
I3
|
|
281
|
+
I15
|
|
282
|
+
I44
|
|
283
|
+
I49
|
|
284
|
+
I6
|
|
285
|
+
I246
|
|
286
|
+
I1
|
|
287
|
+
tp99
|
|
288
|
+
(dp100
|
|
289
|
+
tp101
|
|
290
|
+
Rp102
|
|
291
|
+
sg35
|
|
292
|
+
(lp103
|
|
293
|
+
sg37
|
|
294
|
+
g30
|
|
295
|
+
((I2023
|
|
296
|
+
I9
|
|
297
|
+
I3
|
|
298
|
+
I14
|
|
299
|
+
I39
|
|
300
|
+
I31
|
|
301
|
+
I6
|
|
302
|
+
I246
|
|
303
|
+
I1
|
|
304
|
+
tp104
|
|
305
|
+
(dp105
|
|
306
|
+
tp106
|
|
307
|
+
Rp107
|
|
308
|
+
sbsa(dp108
|
|
309
|
+
g18
|
|
310
|
+
I00
|
|
311
|
+
sg19
|
|
312
|
+
(lp109
|
|
313
|
+
F401.0
|
|
314
|
+
aF10.0
|
|
315
|
+
asg21
|
|
316
|
+
(itiddlywiki
|
|
317
|
+
Tiddler
|
|
318
|
+
p110
|
|
319
|
+
(dp111
|
|
320
|
+
g25
|
|
321
|
+
Vdd
|
|
322
|
+
p112
|
|
323
|
+
sg27
|
|
324
|
+
VUntitled Passage 4
|
|
325
|
+
p113
|
|
326
|
+
sg29
|
|
327
|
+
g30
|
|
328
|
+
((I2023
|
|
329
|
+
I9
|
|
330
|
+
I3
|
|
331
|
+
I15
|
|
332
|
+
I43
|
|
333
|
+
I10
|
|
334
|
+
I6
|
|
335
|
+
I246
|
|
336
|
+
I1
|
|
337
|
+
tp114
|
|
338
|
+
(dp115
|
|
339
|
+
tp116
|
|
340
|
+
Rp117
|
|
341
|
+
sg35
|
|
342
|
+
(lp118
|
|
343
|
+
sg37
|
|
344
|
+
g30
|
|
345
|
+
((I2023
|
|
346
|
+
I9
|
|
347
|
+
I3
|
|
348
|
+
I14
|
|
349
|
+
I39
|
|
350
|
+
I31
|
|
351
|
+
I6
|
|
352
|
+
I246
|
|
353
|
+
I1
|
|
354
|
+
tp119
|
|
355
|
+
(dp120
|
|
356
|
+
tp121
|
|
357
|
+
Rp122
|
|
358
|
+
sbsa(dp123
|
|
359
|
+
g18
|
|
360
|
+
I00
|
|
361
|
+
sg19
|
|
362
|
+
(lp124
|
|
363
|
+
F402.0
|
|
364
|
+
aF150.0
|
|
365
|
+
asg21
|
|
366
|
+
(itiddlywiki
|
|
367
|
+
Tiddler
|
|
368
|
+
p125
|
|
369
|
+
(dp126
|
|
370
|
+
g25
|
|
371
|
+
S'jquery:off\nhash:off\nbookmark:on\nmodernizr:off\nundo:on\nobfuscate:off\nexitprompt:off\nblankcss:off\n'
|
|
372
|
+
p127
|
|
373
|
+
sg27
|
|
374
|
+
VStorySettings
|
|
375
|
+
p128
|
|
376
|
+
sg29
|
|
377
|
+
g30
|
|
378
|
+
((I2023
|
|
379
|
+
I9
|
|
380
|
+
I3
|
|
381
|
+
I15
|
|
382
|
+
I20
|
|
383
|
+
I35
|
|
384
|
+
I6
|
|
385
|
+
I246
|
|
386
|
+
I1
|
|
387
|
+
tp129
|
|
388
|
+
(dp130
|
|
389
|
+
tp131
|
|
390
|
+
Rp132
|
|
391
|
+
sg35
|
|
392
|
+
(lp133
|
|
393
|
+
sg37
|
|
394
|
+
g30
|
|
395
|
+
((I2023
|
|
396
|
+
I9
|
|
397
|
+
I3
|
|
398
|
+
I15
|
|
399
|
+
I20
|
|
400
|
+
I35
|
|
401
|
+
I6
|
|
402
|
+
I246
|
|
403
|
+
I1
|
|
404
|
+
tp134
|
|
405
|
+
(dp135
|
|
406
|
+
tp136
|
|
407
|
+
Rp137
|
|
408
|
+
sbsasS'scale'
|
|
409
|
+
p138
|
|
410
|
+
F6.200000000000003
|
|
411
|
+
sS'snapping'
|
|
412
|
+
p139
|
|
413
|
+
I00
|
|
414
|
+
ss.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { parse as parseTwee } from '../../src/Twee/parse.js';
|
|
3
|
+
|
|
4
|
+
describe('Twee', () => {
|
|
5
|
+
describe('parse()', () => {
|
|
6
|
+
it('Should throw error if non-string is used', () => {
|
|
7
|
+
expect(() => { parseTwee(1); }).toThrow();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('Should throw error if empty string is used', () => {
|
|
11
|
+
expect(() => { parseTwee(); }).toThrow();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('Should throw error if no passages are present', () => {
|
|
15
|
+
expect(() => { parseTwee('()()'); }).toThrow();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('Should throw error if it detects malformed passage headers', () => {
|
|
19
|
+
expect(() => { parseTwee('::{}[]\nNo name'); }).toThrow();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('Should cut notes before passages', () => {
|
|
23
|
+
const fr = readFileSync('test/Twee/TweeParser/notes.twee', 'utf-8');
|
|
24
|
+
const story = parseTwee(fr);
|
|
25
|
+
expect(story.name).toBe('twineExample');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('Should be able to parse Twee file for Story Name', () => {
|
|
29
|
+
const fr = readFileSync('test/Twee/TweeParser/example.twee', 'utf-8');
|
|
30
|
+
const story = parseTwee(fr);
|
|
31
|
+
expect(story.name).toBe('twineExample');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Should parse single tag on Start passage', () => {
|
|
35
|
+
const fr = readFileSync('test/Twee/TweeParser/singletag.twee', 'utf-8');
|
|
36
|
+
const story = parseTwee(fr);
|
|
37
|
+
const start = story.getPassageByName('Start');
|
|
38
|
+
expect(start.tags).toHaveLength(1);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Should parse multiple tag', () => {
|
|
42
|
+
const fr = readFileSync('test/Twee/TweeParser/multipletags.twee', 'utf-8');
|
|
43
|
+
const story = parseTwee(fr);
|
|
44
|
+
const start = story.getPassageByName('Start');
|
|
45
|
+
expect(start.tags).toHaveLength(2);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('Should parse single script passage', () => {
|
|
49
|
+
const fr = readFileSync('test/Twee/TweeParser/scriptPassage.twee', 'utf-8');
|
|
50
|
+
const story = parseTwee(fr);
|
|
51
|
+
const p = story.getPassageByName('UserScript');
|
|
52
|
+
expect(p.tags).toHaveLength(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('Should parse single stylesheet passage', () => {
|
|
56
|
+
const fr = readFileSync('test/Twee/TweeParser/stylePassage.twee', 'utf-8');
|
|
57
|
+
const story = parseTwee(fr);
|
|
58
|
+
const p = story.getPassageByName('UserStylesheet');
|
|
59
|
+
expect(p.tags).toHaveLength(1);
|
|
60
|
+
expect(p.name).toBe('UserStylesheet');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('Should parse StoryTitle', () => {
|
|
64
|
+
const fr = readFileSync('test/Twee/TweeParser/test.twee', 'utf-8');
|
|
65
|
+
const story = parseTwee(fr);
|
|
66
|
+
expect(story.name).not.toBe(null);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('Should parse StoryAuthor', () => {
|
|
70
|
+
const fr = readFileSync('test/Twee/TweeParser/example.twee', 'utf-8');
|
|
71
|
+
const story = parseTwee(fr);
|
|
72
|
+
const p = story.getPassageByName('StoryAuthor');
|
|
73
|
+
expect(p).not.toBe(null);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:: Start []
|
|
2
|
-
Content
|
|
1
|
+
:: Start []
|
|
2
|
+
Content
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
:: StoryTitle
|
|
2
|
-
twineExample
|
|
3
|
-
|
|
4
|
-
:: StoryAuthor
|
|
5
|
-
Dan
|
|
6
|
-
|
|
7
|
-
:: Start {"position":"102,104","size":"100,100"}
|
|
8
|
-
[[Another passage]]
|
|
9
|
-
|
|
10
|
-
[[A third passage]]
|
|
11
|
-
|
|
12
|
-
:: Another passage {"position":"353,60","size":"100,100"}
|
|
13
|
-
[[A fourth passage]]
|
|
14
|
-
|
|
15
|
-
[[A third passage]]
|
|
16
|
-
|
|
17
|
-
:: A third passage {"position":"350,288","size":"100,100"}
|
|
18
|
-
[[Start]]
|
|
19
|
-
|
|
20
|
-
:: A fourth passage {"position":"587,197","size":"100,100"}
|
|
21
|
-
[[A fifth passage]]
|
|
22
|
-
|
|
23
|
-
:: A fifth passage {"position":"800,306","size":"100,100"}
|
|
24
|
-
Double-click this passage to edit it.
|
|
25
|
-
|
|
26
|
-
:: StoryData
|
|
27
|
-
{
|
|
28
|
-
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
29
|
-
"format": "Harlowe",
|
|
30
|
-
"formatVersion": "2.1.0",
|
|
31
|
-
"zoom": "1"
|
|
32
|
-
}
|
|
1
|
+
:: StoryTitle
|
|
2
|
+
twineExample
|
|
3
|
+
|
|
4
|
+
:: StoryAuthor
|
|
5
|
+
Dan
|
|
6
|
+
|
|
7
|
+
:: Start {"position":"102,104","size":"100,100"}
|
|
8
|
+
[[Another passage]]
|
|
9
|
+
|
|
10
|
+
[[A third passage]]
|
|
11
|
+
|
|
12
|
+
:: Another passage {"position":"353,60","size":"100,100"}
|
|
13
|
+
[[A fourth passage]]
|
|
14
|
+
|
|
15
|
+
[[A third passage]]
|
|
16
|
+
|
|
17
|
+
:: A third passage {"position":"350,288","size":"100,100"}
|
|
18
|
+
[[Start]]
|
|
19
|
+
|
|
20
|
+
:: A fourth passage {"position":"587,197","size":"100,100"}
|
|
21
|
+
[[A fifth passage]]
|
|
22
|
+
|
|
23
|
+
:: A fifth passage {"position":"800,306","size":"100,100"}
|
|
24
|
+
Double-click this passage to edit it.
|
|
25
|
+
|
|
26
|
+
:: StoryData
|
|
27
|
+
{
|
|
28
|
+
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
29
|
+
"format": "Harlowe",
|
|
30
|
+
"formatVersion": "2.1.0",
|
|
31
|
+
"zoom": "1"
|
|
32
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
:: StoryTitle
|
|
2
|
-
twineExample
|
|
3
|
-
|
|
4
|
-
:: Start
|
|
5
|
-
This is the start passage
|
|
6
|
-
|
|
7
|
-
:: Another passage {"position":"353,60","size":"100,100"}
|
|
8
|
-
[[A fourth passage]]
|
|
9
|
-
|
|
10
|
-
[[A third passage]]
|
|
11
|
-
|
|
12
|
-
:: A third passage {"position":"350,288","size":"100,100"}
|
|
13
|
-
[[Start]]
|
|
14
|
-
|
|
15
|
-
:: A fourth passage {"position":"587,197","size":"100,100"}
|
|
16
|
-
[[A fifth passage]]
|
|
17
|
-
|
|
18
|
-
:: A fifth passage {"position":"800,306","size":"100,100"}
|
|
19
|
-
Double-click this passage to edit it.
|
|
1
|
+
:: StoryTitle
|
|
2
|
+
twineExample
|
|
3
|
+
|
|
4
|
+
:: Start
|
|
5
|
+
This is the start passage
|
|
6
|
+
|
|
7
|
+
:: Another passage {"position":"353,60","size":"100,100"}
|
|
8
|
+
[[A fourth passage]]
|
|
9
|
+
|
|
10
|
+
[[A third passage]]
|
|
11
|
+
|
|
12
|
+
:: A third passage {"position":"350,288","size":"100,100"}
|
|
13
|
+
[[Start]]
|
|
14
|
+
|
|
15
|
+
:: A fourth passage {"position":"587,197","size":"100,100"}
|
|
16
|
+
[[A fifth passage]]
|
|
17
|
+
|
|
18
|
+
:: A fifth passage {"position":"800,306","size":"100,100"}
|
|
19
|
+
Double-click this passage to edit it.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
:: Start
|
|
2
|
-
Content
|
|
3
|
-
|
|
4
|
-
:: StoryTitle
|
|
5
|
-
Title
|
|
6
|
-
|
|
7
|
-
:: UserScript [script]
|
|
8
|
-
1
|
|
9
|
-
|
|
10
|
-
:: UserScript2 [script]
|
|
11
|
-
2
|
|
12
|
-
|
|
13
|
-
:: StoryData
|
|
14
|
-
{
|
|
15
|
-
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
16
|
-
"format": "Harlowe",
|
|
17
|
-
"formatVersion": "2.1.0",
|
|
18
|
-
"zoom": "1"
|
|
19
|
-
}
|
|
1
|
+
:: Start
|
|
2
|
+
Content
|
|
3
|
+
|
|
4
|
+
:: StoryTitle
|
|
5
|
+
Title
|
|
6
|
+
|
|
7
|
+
:: UserScript [script]
|
|
8
|
+
1
|
|
9
|
+
|
|
10
|
+
:: UserScript2 [script]
|
|
11
|
+
2
|
|
12
|
+
|
|
13
|
+
:: StoryData
|
|
14
|
+
{
|
|
15
|
+
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
16
|
+
"format": "Harlowe",
|
|
17
|
+
"formatVersion": "2.1.0",
|
|
18
|
+
"zoom": "1"
|
|
19
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
:: Start
|
|
2
|
-
Content
|
|
3
|
-
|
|
4
|
-
:: StoryTitle
|
|
5
|
-
Title
|
|
6
|
-
|
|
7
|
-
:: UserStylesheet1 [stylesheet]
|
|
8
|
-
1
|
|
9
|
-
|
|
10
|
-
:: UserStylesheet2 [stylesheet]
|
|
11
|
-
2
|
|
12
|
-
|
|
13
|
-
:: StoryData
|
|
14
|
-
{
|
|
15
|
-
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
16
|
-
"format": "Harlowe",
|
|
17
|
-
"formatVersion": "2.1.0",
|
|
18
|
-
"zoom": "1"
|
|
19
|
-
}
|
|
1
|
+
:: Start
|
|
2
|
+
Content
|
|
3
|
+
|
|
4
|
+
:: StoryTitle
|
|
5
|
+
Title
|
|
6
|
+
|
|
7
|
+
:: UserStylesheet1 [stylesheet]
|
|
8
|
+
1
|
|
9
|
+
|
|
10
|
+
:: UserStylesheet2 [stylesheet]
|
|
11
|
+
2
|
|
12
|
+
|
|
13
|
+
:: StoryData
|
|
14
|
+
{
|
|
15
|
+
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128",
|
|
16
|
+
"format": "Harlowe",
|
|
17
|
+
"formatVersion": "2.1.0",
|
|
18
|
+
"zoom": "1"
|
|
19
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
:: Start [tag tags]
|
|
2
|
-
Content
|
|
3
|
-
|
|
4
|
-
:: StoryTitle
|
|
5
|
-
Title
|
|
6
|
-
|
|
7
|
-
:: StoryData
|
|
8
|
-
{
|
|
9
|
-
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128"
|
|
10
|
-
}
|
|
1
|
+
:: Start [tag tags]
|
|
2
|
+
Content
|
|
3
|
+
|
|
4
|
+
:: StoryTitle
|
|
5
|
+
Title
|
|
6
|
+
|
|
7
|
+
:: StoryData
|
|
8
|
+
{
|
|
9
|
+
"ifid": "2B68ECD6-348F-4CF5-96F8-549A512A8128"
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:: Start
|
|
2
|
-
Nothing else
|
|
1
|
+
:: Start
|
|
2
|
+
Nothing else
|