You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
563 B
Groovy
22 lines
563 B
Groovy
package org.xbib.gradle.plugin.asciidoctor.groovydsl.extensions
|
|
|
|
import org.asciidoctor.ast.Document
|
|
import org.asciidoctor.extension.Preprocessor
|
|
import org.asciidoctor.extension.PreprocessorReader
|
|
|
|
class DelegatingPreprocessor extends Preprocessor {
|
|
|
|
private final Closure cl
|
|
|
|
DelegatingPreprocessor(Map options, @DelegatesTo(Preprocessor) Closure cl) {
|
|
super(options)
|
|
this.cl = cl
|
|
cl.delegate = this
|
|
}
|
|
|
|
@Override
|
|
void process(Document document, PreprocessorReader reader) {
|
|
cl.call(document, reader)
|
|
}
|
|
}
|