-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (35 loc) · 1.11 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/tei.css">
<script src="../js/CETEI.js"></script>
<script>
let c = new CETEI();
let behaviors = {
"tei": {
"head": function(e) {
let level = document.evaluate("count(ancestor::tei-div)", e, null, XPathResult.NUMBER_TYPE, null);
let result = document.createElement("h" + (level.numberValue>7 ? 7 : level.numberValue));
for (let n of Array.from(e.childNodes)) {
result.appendChild(n.cloneNode());
}
return result;
},
"lb": ["<br>"],
/* Insert a <p> with the content of the <pb>'s @n attribute inside it
Add a line above with CSS */
"pb": ["<p class=\"break\">$@n</p>"],
}
};
c.addBehaviors(behaviors);
c.getHTML5('../fpn-washington.xml', function(data){
document.getElementsByTagName('body')[0].appendChild(data);
});
</script>
</head>
<body>
</body>
</html>