CETEIcean 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.vscode/settings.json +6 -0
- package/README.md +1 -4
- package/TEI-CE_specification.md +86 -0
- package/package.json +1 -1
- package/src/CETEI.js +53 -44
- package/src/behaviors.js +1 -1
- package/src/defaultBehaviors.js +6 -2
- package/src/dom.js +1 -1
- package/src/utilities.js +57 -32
- package/test/CETEIcean.css +3 -0
- package/test/P5.css +362 -0
- package/test/addBehaviorTest.html +1 -1
- package/test/nodeTest.js +13 -3
- package/test/tcw20.html +960 -0
- package/test/tcw22.xml +468 -0
- package/test/testTEI.xml +5 -1
- package/tutorial_es/Ruy_Diaz-La_Argentina_Manuscrita.tei.xml +11579 -0
- package/xslt/make-CETEIcean-3.xsl +79 -0
package/test/P5.css
ADDED
@@ -0,0 +1,362 @@
|
|
1
|
+
tei-ab {
|
2
|
+
display:block;
|
3
|
+
}
|
4
|
+
tei-back {
|
5
|
+
display:block;
|
6
|
+
}
|
7
|
+
tei-body {
|
8
|
+
display: block;
|
9
|
+
}
|
10
|
+
tei-caption { display: block; }
|
11
|
+
tei-castitem {
|
12
|
+
display: list-item;
|
13
|
+
}
|
14
|
+
tei-castlist {
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
tei-cell {
|
18
|
+
display: table-cell;
|
19
|
+
padding: 1px;
|
20
|
+
vertical-align: inherit;
|
21
|
+
}
|
22
|
+
tei-code {
|
23
|
+
font-family: monospace;
|
24
|
+
white-space:pre;
|
25
|
+
}
|
26
|
+
tei-colophon {
|
27
|
+
display: block;
|
28
|
+
}
|
29
|
+
tei-dateline {
|
30
|
+
display: block;
|
31
|
+
}
|
32
|
+
tei-del {
|
33
|
+
text-decoration: line-through;
|
34
|
+
}
|
35
|
+
tei-div, tei-div1, tei-div2, tei-div3, tei-div4, tei-div5, tei-div6, tei-div7, tei-divgen {
|
36
|
+
display:block;
|
37
|
+
margin:1em;
|
38
|
+
}
|
39
|
+
teieg-egxml {
|
40
|
+
display: block;
|
41
|
+
margin-block-start: 1em;
|
42
|
+
margin-block-end: 1em;
|
43
|
+
font-family: monospace;
|
44
|
+
white-space: pre;
|
45
|
+
}
|
46
|
+
tei-emph {
|
47
|
+
font-style: italic;
|
48
|
+
}
|
49
|
+
tei-figure {
|
50
|
+
display: block;
|
51
|
+
}
|
52
|
+
tei-floatingtext {
|
53
|
+
display: block;
|
54
|
+
}
|
55
|
+
tei-head {
|
56
|
+
display: block;
|
57
|
+
}
|
58
|
+
tei-hi[rend~="bold"] {
|
59
|
+
font-weight: bold;
|
60
|
+
}
|
61
|
+
tei-hi[rend~="italic"] {
|
62
|
+
font-style: italic;
|
63
|
+
}
|
64
|
+
tei-hi[rend~="underline"] {
|
65
|
+
text-decoration: underline;
|
66
|
+
}
|
67
|
+
tei-item {
|
68
|
+
display:list-item;
|
69
|
+
}
|
70
|
+
tei-l {
|
71
|
+
display:block;
|
72
|
+
}
|
73
|
+
tei-lg {
|
74
|
+
display:block;
|
75
|
+
}
|
76
|
+
tei-list {
|
77
|
+
display: block;
|
78
|
+
}
|
79
|
+
tei-list[rend="numbered"] {
|
80
|
+
list-style-type: decimal;
|
81
|
+
}
|
82
|
+
tei-list[rend="bulleted"] {
|
83
|
+
list-style-type: disc;
|
84
|
+
}
|
85
|
+
tei-listannotation {
|
86
|
+
display: block;
|
87
|
+
}
|
88
|
+
tei-listapp {
|
89
|
+
display: block;
|
90
|
+
}
|
91
|
+
tei-listapp > tei-app {
|
92
|
+
display: list-item;
|
93
|
+
}
|
94
|
+
tei-listbibl {
|
95
|
+
display: block;
|
96
|
+
}
|
97
|
+
tei-listbibl > tei-bibl {
|
98
|
+
display: list-item;
|
99
|
+
}
|
100
|
+
tei-listchange {
|
101
|
+
display: block;
|
102
|
+
}
|
103
|
+
|
104
|
+
tei-listevent {
|
105
|
+
display: block;
|
106
|
+
}
|
107
|
+
tei-listnym {
|
108
|
+
display: block;
|
109
|
+
}
|
110
|
+
tei-listobject {
|
111
|
+
display: block;
|
112
|
+
}
|
113
|
+
tei-listorg {
|
114
|
+
display: block;
|
115
|
+
}
|
116
|
+
tei-listperson {
|
117
|
+
display: block;
|
118
|
+
}
|
119
|
+
tei-listplace {
|
120
|
+
display: block;
|
121
|
+
}
|
122
|
+
tei-listref {
|
123
|
+
display: block;
|
124
|
+
}
|
125
|
+
tei-listwit {
|
126
|
+
display: block;
|
127
|
+
}
|
128
|
+
|
129
|
+
tei-p {
|
130
|
+
display: block;
|
131
|
+
}
|
132
|
+
tei-param { /* placeholder */ }
|
133
|
+
tei-paramlist { /* placeholder */ }
|
134
|
+
tei-paramspec { /* placeholder */ }
|
135
|
+
tei-particdesc { /* placeholder */ }
|
136
|
+
tei-path { /* placeholder */ }
|
137
|
+
tei-pause { /* placeholder */ }
|
138
|
+
tei-pb { /* placeholder */ }
|
139
|
+
tei-pc { /* placeholder */ }
|
140
|
+
tei-per { /* placeholder */ }
|
141
|
+
tei-performance { /* placeholder */ }
|
142
|
+
tei-persname { /* placeholder */ }
|
143
|
+
tei-person { /* placeholder */ }
|
144
|
+
tei-persona { /* placeholder */ }
|
145
|
+
tei-persongrp { /* placeholder */ }
|
146
|
+
tei-phr { /* placeholder */ }
|
147
|
+
tei-physdesc { /* placeholder */ }
|
148
|
+
tei-place { /* placeholder */ }
|
149
|
+
tei-placename { /* placeholder */ }
|
150
|
+
tei-population { /* placeholder */ }
|
151
|
+
tei-pos { /* placeholder */ }
|
152
|
+
tei-postbox { /* placeholder */ }
|
153
|
+
tei-postcode { /* placeholder */ }
|
154
|
+
tei-postscript { /* placeholder */ }
|
155
|
+
tei-precision { /* placeholder */ }
|
156
|
+
tei-pref { /* placeholder */ }
|
157
|
+
tei-prefixdef { /* placeholder */ }
|
158
|
+
tei-preparedness { /* placeholder */ }
|
159
|
+
tei-principal { /* placeholder */ }
|
160
|
+
tei-profiledesc { /* placeholder */ }
|
161
|
+
tei-projectdesc { /* placeholder */ }
|
162
|
+
tei-prologue { /* placeholder */ }
|
163
|
+
tei-pron { /* placeholder */ }
|
164
|
+
tei-provenance { /* placeholder */ }
|
165
|
+
tei-ptr { /* placeholder */ }
|
166
|
+
tei-publicationstmt { /* placeholder */ }
|
167
|
+
tei-publisher { /* placeholder */ }
|
168
|
+
tei-pubplace { /* placeholder */ }
|
169
|
+
tei-punctuation { /* placeholder */ }
|
170
|
+
tei-purpose { /* placeholder */ }
|
171
|
+
tei-q { /* placeholder */ }
|
172
|
+
tei-quotation { /* placeholder */ }
|
173
|
+
tei-quote { /* placeholder */ }
|
174
|
+
tei-rdg {
|
175
|
+
display: none;
|
176
|
+
}
|
177
|
+
tei-rdggrp { /* placeholder */ }
|
178
|
+
tei-re { /* placeholder */ }
|
179
|
+
tei-recordhist { /* placeholder */ }
|
180
|
+
tei-recording { /* placeholder */ }
|
181
|
+
tei-recordingstmt { /* placeholder */ }
|
182
|
+
tei-redo { /* placeholder */ }
|
183
|
+
tei-ref { /* placeholder */ }
|
184
|
+
tei-refsdecl { /* placeholder */ }
|
185
|
+
tei-refstate { /* placeholder */ }
|
186
|
+
tei-reg { /* placeholder */ }
|
187
|
+
tei-region { /* placeholder */ }
|
188
|
+
tei-relateditem { /* placeholder */ }
|
189
|
+
tei-relation { /* placeholder */ }
|
190
|
+
tei-remarks { /* placeholder */ }
|
191
|
+
tei-rendition { /* placeholder */ }
|
192
|
+
tei-repository { /* placeholder */ }
|
193
|
+
tei-residence { /* placeholder */ }
|
194
|
+
tei-resp { /* placeholder */ }
|
195
|
+
tei-respons { /* placeholder */ }
|
196
|
+
tei-respstmt { /* placeholder */ }
|
197
|
+
tei-restore { /* placeholder */ }
|
198
|
+
tei-retrace { /* placeholder */ }
|
199
|
+
tei-revisiondesc { /* placeholder */ }
|
200
|
+
tei-rhyme { /* placeholder */ }
|
201
|
+
tei-role { /* placeholder */ }
|
202
|
+
tei-roledesc { /* placeholder */ }
|
203
|
+
tei-rolename { /* placeholder */ }
|
204
|
+
tei-root { /* placeholder */ }
|
205
|
+
tei-row {
|
206
|
+
display: table-row;
|
207
|
+
border-color: inherit;
|
208
|
+
vertical-align: inherit;
|
209
|
+
}
|
210
|
+
tei-rs { /* placeholder */ }
|
211
|
+
tei-rubric { /* placeholder */ }
|
212
|
+
tei-s { /* placeholder */ }
|
213
|
+
tei-said { /* placeholder */ }
|
214
|
+
tei-salute { /* placeholder */ }
|
215
|
+
tei-samplingdecl { /* placeholder */ }
|
216
|
+
tei-schemaref { /* placeholder */ }
|
217
|
+
tei-schemaspec { /* placeholder */ }
|
218
|
+
tei-scriptdesc { /* placeholder */ }
|
219
|
+
tei-scriptnote { /* placeholder */ }
|
220
|
+
tei-scriptstmt { /* placeholder */ }
|
221
|
+
tei-seal { /* placeholder */ }
|
222
|
+
tei-sealdesc { /* placeholder */ }
|
223
|
+
tei-secfol { /* placeholder */ }
|
224
|
+
tei-secl { /* placeholder */ }
|
225
|
+
tei-seg { /* placeholder */ }
|
226
|
+
tei-segmentation { /* placeholder */ }
|
227
|
+
tei-sense { /* placeholder */ }
|
228
|
+
tei-sequence { /* placeholder */ }
|
229
|
+
tei-series { /* placeholder */ }
|
230
|
+
tei-seriesstmt { /* placeholder */ }
|
231
|
+
tei-set { /* placeholder */ }
|
232
|
+
tei-setting { /* placeholder */ }
|
233
|
+
tei-settingdesc { /* placeholder */ }
|
234
|
+
tei-settlement { /* placeholder */ }
|
235
|
+
tei-sex { /* placeholder */ }
|
236
|
+
tei-shift { /* placeholder */ }
|
237
|
+
tei-sic { /* placeholder */ }
|
238
|
+
tei-signatures { /* placeholder */ }
|
239
|
+
tei-signed { /* placeholder */ }
|
240
|
+
tei-socalled { /* placeholder */ }
|
241
|
+
tei-socecstatus { /* placeholder */ }
|
242
|
+
tei-sound { /* placeholder */ }
|
243
|
+
tei-source { /* placeholder */ }
|
244
|
+
tei-sourcedesc { /* placeholder */ }
|
245
|
+
tei-sourcedoc { /* placeholder */ }
|
246
|
+
tei-sp { /* placeholder */ }
|
247
|
+
tei-space { /* placeholder */ }
|
248
|
+
tei-span { /* placeholder */ }
|
249
|
+
tei-spangrp { /* placeholder */ }
|
250
|
+
tei-speaker { /* placeholder */ }
|
251
|
+
tei-specdesc { /* placeholder */ }
|
252
|
+
tei-specgrp { /* placeholder */ }
|
253
|
+
tei-specgrpref { /* placeholder */ }
|
254
|
+
tei-speclist { /* placeholder */ }
|
255
|
+
tei-spgrp { /* placeholder */ }
|
256
|
+
tei-sponsor { /* placeholder */ }
|
257
|
+
tei-stage { /* placeholder */ }
|
258
|
+
tei-stamp { /* placeholder */ }
|
259
|
+
tei-standoff {
|
260
|
+
display: none;
|
261
|
+
}
|
262
|
+
tei-state { /* placeholder */ }
|
263
|
+
tei-stdvals { /* placeholder */ }
|
264
|
+
tei-street { /* placeholder */ }
|
265
|
+
tei-stress { /* placeholder */ }
|
266
|
+
tei-string { /* placeholder */ }
|
267
|
+
tei-styledefdecl { /* placeholder */ }
|
268
|
+
tei-subc { /* placeholder */ }
|
269
|
+
tei-subst { /* placeholder */ }
|
270
|
+
tei-substjoin { /* placeholder */ }
|
271
|
+
tei-summary { /* placeholder */ }
|
272
|
+
tei-superentry { /* placeholder */ }
|
273
|
+
tei-supplied { /* placeholder */ }
|
274
|
+
tei-support { /* placeholder */ }
|
275
|
+
tei-supportdesc { /* placeholder */ }
|
276
|
+
tei-surface { /* placeholder */ }
|
277
|
+
tei-surfacegrp { /* placeholder */ }
|
278
|
+
tei-surname { /* placeholder */ }
|
279
|
+
tei-surplus { /* placeholder */ }
|
280
|
+
tei-surrogates { /* placeholder */ }
|
281
|
+
tei-syll { /* placeholder */ }
|
282
|
+
tei-symbol { /* placeholder */ }
|
283
|
+
tei-table {
|
284
|
+
display: table;
|
285
|
+
box-sizing: border-box;
|
286
|
+
border-spacing: 2px;
|
287
|
+
border-collapse: separate;
|
288
|
+
text-indent: initial;
|
289
|
+
}
|
290
|
+
tei-tag { /* placeholder */ }
|
291
|
+
tei-tagsdecl { /* placeholder */ }
|
292
|
+
tei-tagusage { /* placeholder */ }
|
293
|
+
tei-taxonomy { /* placeholder */ }
|
294
|
+
tei-tech { /* placeholder */ }
|
295
|
+
tei-tei { /* placeholder */ }
|
296
|
+
tei-teicorpus { /* placeholder */ }
|
297
|
+
tei-teiheader {
|
298
|
+
display: none;
|
299
|
+
}
|
300
|
+
tei-term { /* placeholder */ }
|
301
|
+
tei-terrain { /* placeholder */ }
|
302
|
+
tei-text { /* placeholder */ }
|
303
|
+
tei-textclass { /* placeholder */ }
|
304
|
+
tei-textdesc { /* placeholder */ }
|
305
|
+
tei-textlang { /* placeholder */ }
|
306
|
+
tei-textnode { /* placeholder */ }
|
307
|
+
tei-then { /* placeholder */ }
|
308
|
+
tei-time { /* placeholder */ }
|
309
|
+
tei-timeline { /* placeholder */ }
|
310
|
+
tei-title { /* placeholder */ }
|
311
|
+
tei-titlepage { /* placeholder */ }
|
312
|
+
tei-titlepart { /* placeholder */ }
|
313
|
+
tei-titlestmt { /* placeholder */ }
|
314
|
+
tei-tns { /* placeholder */ }
|
315
|
+
tei-trailer { /* placeholder */ }
|
316
|
+
tei-trait { /* placeholder */ }
|
317
|
+
tei-transcriptiondesc { /* placeholder */ }
|
318
|
+
tei-transpose { /* placeholder */ }
|
319
|
+
tei-tree { /* placeholder */ }
|
320
|
+
tei-triangle { /* placeholder */ }
|
321
|
+
tei-typedesc { /* placeholder */ }
|
322
|
+
tei-typenote { /* placeholder */ }
|
323
|
+
tei-u { /* placeholder */ }
|
324
|
+
tei-unclear { /* placeholder */ }
|
325
|
+
tei-undo { /* placeholder */ }
|
326
|
+
tei-unicodename { /* placeholder */ }
|
327
|
+
tei-unicodeprop { /* placeholder */ }
|
328
|
+
tei-unihanprop { /* placeholder */ }
|
329
|
+
tei-unit { /* placeholder */ }
|
330
|
+
tei-unitdecl { /* placeholder */ }
|
331
|
+
tei-unitdef { /* placeholder */ }
|
332
|
+
tei-usg { /* placeholder */ }
|
333
|
+
tei-val { /* placeholder */ }
|
334
|
+
tei-valdesc { /* placeholder */ }
|
335
|
+
tei-valitem { /* placeholder */ }
|
336
|
+
tei-vallist { /* placeholder */ }
|
337
|
+
tei-valt { /* placeholder */ }
|
338
|
+
tei-value { /* placeholder */ }
|
339
|
+
tei-variantencoding { /* placeholder */ }
|
340
|
+
tei-vcoll { /* placeholder */ }
|
341
|
+
tei-vdefault { /* placeholder */ }
|
342
|
+
tei-view { /* placeholder */ }
|
343
|
+
tei-vlabel { /* placeholder */ }
|
344
|
+
tei-vmerge { /* placeholder */ }
|
345
|
+
tei-vnot { /* placeholder */ }
|
346
|
+
tei-vocal { /* placeholder */ }
|
347
|
+
tei-vrange { /* placeholder */ }
|
348
|
+
tei-w { /* placeholder */ }
|
349
|
+
tei-watermark { /* placeholder */ }
|
350
|
+
tei-when { /* placeholder */ }
|
351
|
+
tei-width { /* placeholder */ }
|
352
|
+
tei-wit { /* placeholder */ }
|
353
|
+
tei-witdetail { /* placeholder */ }
|
354
|
+
tei-witend { /* placeholder */ }
|
355
|
+
tei-witness { /* placeholder */ }
|
356
|
+
tei-witstart { /* placeholder */ }
|
357
|
+
tei-writing { /* placeholder */ }
|
358
|
+
tei-xenodata {
|
359
|
+
display: none;
|
360
|
+
}
|
361
|
+
tei-xr { /* placeholder */ }
|
362
|
+
tei-zone { /* placeholder */ }
|
@@ -34,7 +34,7 @@
|
|
34
34
|
return b;
|
35
35
|
},
|
36
36
|
// Inserts the first array element before tei:add, and the second, after.
|
37
|
-
"add": ["<b
|
37
|
+
"add": ["<b><span>`</span>","´</b>"]
|
38
38
|
}});
|
39
39
|
c.getHTML5('testTEI.xml', function(data) {
|
40
40
|
document.getElementById("TEI").innerHTML = "";
|
package/test/nodeTest.js
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
2
2
|
import CETEI from '../src/CETEI.js';
|
3
|
+
import fs from 'fs';
|
3
4
|
|
4
|
-
const
|
5
|
+
const tei = fs.readFileSync('test/testTEI.xml', 'utf8');
|
6
|
+
const jdom = new JSDOM(tei, {contentType: 'text/xml'});
|
5
7
|
const teiDoc = jdom.window.document;
|
6
8
|
|
7
9
|
const test = () => {
|
8
10
|
console.log('Get HTML5 from JSDOM');
|
9
|
-
const
|
11
|
+
const c = new CETEI({documentObject: teiDoc});
|
12
|
+
const processedTEI = c.domToHTML5(teiDoc);
|
10
13
|
if (processedTEI) {
|
11
14
|
console.log(' > pass');
|
12
15
|
} else {
|
@@ -14,7 +17,14 @@ const test = () => {
|
|
14
17
|
return;
|
15
18
|
}
|
16
19
|
console.log('Check content');
|
17
|
-
if (processedTEI.querySelector("tei-
|
20
|
+
if (processedTEI.querySelector("tei-p")) {
|
21
|
+
console.log(' > pass');
|
22
|
+
} else {
|
23
|
+
console.log(' > fail');
|
24
|
+
}
|
25
|
+
console.log('Round-trip test');
|
26
|
+
const roundTrip = new JSDOM(c.utilities.resetAndSerialize(processedTEI, false, false), {contentType: 'text/xml'}).window.document;
|
27
|
+
if (teiDoc.querySelectorAll('*').length === roundTrip.querySelectorAll('*').length) {
|
18
28
|
console.log(' > pass');
|
19
29
|
} else {
|
20
30
|
console.log(' > fail');
|