2021-09-01 13:09:09 +02:00
|
|
|
<!DOCTYPE html>
|
2021-11-26 18:59:40 +01:00
|
|
|
<html lang="en-us">
|
2021-09-01 13:09:09 +02:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2021-10-06 17:15:36 +02:00
|
|
|
<link href="./css/pagedjs.css" rel="stylesheet" type="text/css">
|
2021-09-01 13:09:09 +02:00
|
|
|
<link href="./css/print.css" rel="stylesheet" type="text/css" media="print">
|
2022-04-22 14:49:55 +02:00
|
|
|
<!-- BASELINE GRID -->
|
2022-08-30 19:01:52 +02:00
|
|
|
<!-- <link href="./css/baseline.css" rel="stylesheet" type="text/css" media="print"> -->
|
2022-04-22 14:49:55 +02:00
|
|
|
<!-- ------------- -->
|
2021-11-26 18:59:40 +01:00
|
|
|
<script>
|
2022-04-22 14:49:55 +02:00
|
|
|
// Hyphenopoly is used for the hyphenation of the book.
|
2021-12-03 00:01:13 +01:00
|
|
|
// Thank you paged.js team for the Hyphenopoly tip!
|
2021-11-26 18:59:40 +01:00
|
|
|
// config for hyphenopoly
|
|
|
|
var Hyphenopoly = {
|
|
|
|
require: {
|
|
|
|
"en-us": "FORCEHYPHENOPOLY"
|
|
|
|
},
|
|
|
|
paths: {
|
|
|
|
patterndir: "./js/hyphens/patterns/",
|
|
|
|
maindir: "./js/hyphens/"
|
|
|
|
},
|
|
|
|
setup: {
|
|
|
|
dontHyphenateClass: "noHyphen",
|
|
|
|
safeCopy: false,
|
|
|
|
hide: "nothing",
|
|
|
|
selectors: {
|
|
|
|
"p": {
|
|
|
|
hyphen: "\u00AD",
|
|
|
|
// hyphen: "•",
|
|
|
|
compound: "all",
|
|
|
|
minWordLength: 5,
|
|
|
|
leftmin: 3,
|
|
|
|
rightmin: 0,
|
|
|
|
orphanControl: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<script src="./js/hyphens/Hyphenopoly_Loader.js"></script>
|
|
|
|
<script src="./js/paged.polyfill.js"></script>
|
|
|
|
<script src="./js/runHyphens.js"></script>
|
2021-09-01 13:09:09 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
2021-12-03 00:01:13 +01:00
|
|
|
<div id="wrapper">
|
|
|
|
{{ publication_unfolded }}
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
// With many thanks to Julien Taquet for digging into Paged.js
|
|
|
|
// to find a way to remove hyphenated words on page breaks!!
|
|
|
|
class noHyphenBetweenPage extends Paged.Handler {
|
|
|
|
constructor(chunker, polisher, caller) {
|
|
|
|
super(chunker, polisher, caller);
|
|
|
|
this.hyphenToken;
|
|
|
|
}
|
|
|
|
afterPageLayout(pageFragment, page, breakToken) {
|
|
|
|
if (pageFragment.querySelector('.pagedjs_hyphen')) {
|
|
|
|
// find the hyphenated word
|
|
|
|
let block = pageFragment.querySelector('.pagedjs_hyphen');
|
|
|
|
block.dataset.ref = this.prevHyphen;
|
|
|
|
// move the breakToken
|
|
|
|
let offsetMove = getFinalWord(block.innerHTML).length;
|
|
|
|
// move the token accordingly
|
|
|
|
page.breakToken = page.endToken.offset - offsetMove;
|
|
|
|
// remove the last word
|
|
|
|
block.innerHTML = block.innerHTML.replace(getFinalWord(block.innerHTML), "");
|
|
|
|
breakToken.offset = page.endToken.offset - offsetMove;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Paged.registerHandlers(noHyphenBetweenPage);
|
2021-11-08 22:01:36 +01:00
|
|
|
|
2021-12-03 00:01:13 +01:00
|
|
|
function getFinalWord(words) {
|
|
|
|
var n = words.split(" ");
|
|
|
|
return n[n.length - 1];
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
2021-09-01 13:09:09 +02:00
|
|
|
</html>
|