initial commit
This commit is contained in:
commit
abbd549428
97 changed files with 97614 additions and 0 deletions
21
js/custom-handler-example-1.js
Normal file
21
js/custom-handler-example-1.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { Handler } from '/csspageweaver/lib/paged.esm.js';
|
||||
|
||||
export default class myCustomHandler1 extends Handler {
|
||||
constructor(chunker, polisher, caller) {
|
||||
super(chunker, polisher, caller);
|
||||
}
|
||||
|
||||
beforeParsed(content){
|
||||
// let h2 = content.querySelectorAll('h2');
|
||||
// h2.forEach( h2 => {
|
||||
// h2.insertAdjacentHTML("afterbegin", '🍄');
|
||||
// });
|
||||
}
|
||||
|
||||
afterParsed(parsed) {
|
||||
console.info("%c [CSS Page Weaver] Example custom handler 1 with afterParsed hook (see js/custom-handler-example-1.js", 'color: green;');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
16
js/custom-handler-example-2.js
Normal file
16
js/custom-handler-example-2.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { Handler } from '/csspageweaver/lib/paged.esm.js';
|
||||
|
||||
|
||||
export default class myCustomHandler2 extends Handler {
|
||||
constructor(chunker, polisher, caller) {
|
||||
super(chunker, polisher, caller);
|
||||
}
|
||||
|
||||
|
||||
afterPageLayout(pageElement, page, breakToken) {
|
||||
if(pageElement.id == "page-1"){
|
||||
console.info("%c [CSS Page Weaver] Example custom handler 2 with afterPageLayout hook (see js/custom-handler-example-2.js", 'color: green;')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue