1
0

add initial marp implementation with sample content and build configuration

This commit is contained in:
2025-09-13 18:13:22 +02:00
parent dcacc9b409
commit e5f219507f
10319 changed files with 1402023 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import { KeyCode } from './event_util.js';
export class Processor {
static stringify_(x) {
return x ? x.toString() : x;
}
constructor(name, methods) {
this.name = name;
this.process = methods.processor;
this.postprocess =
methods.postprocessor || ((x, _y) => x);
this.processor = this.postprocess
? function (x) {
return this.postprocess(this.process(x), x);
}
: this.process;
this.print = methods.print || Processor.stringify_;
this.pprint = methods.pprint || this.print;
}
}
Processor.LocalState = { walker: null, speechGenerator: null, highlighter: null };
export class KeyProcessor extends Processor {
static getKey_(key) {
return typeof key === 'string'
?
KeyCode[key.toUpperCase()]
: key;
}
constructor(name, methods) {
super(name, methods);
this.key = methods.key || KeyProcessor.getKey_;
}
}