public class RedPenTreeProcessor
extends org.asciidoctor.extension.Treeprocessor
Modifier and Type | Class and Description |
---|---|
protected static class |
RedPenTreeProcessor.BlockAccessor
helper class to inspect and access important asciidoctor information
obscured by JRuby (and AsciiDoctorJ)
|
Constructor and Description |
---|
RedPenTreeProcessor(Document.DocumentBuilder documentBuilder,
SentenceExtractor sentenceExtractor,
Map<String,Object> config)
Build a tree processer that uses the supplied documentBuilder and sentenceExtractor
|
Modifier and Type | Method and Description |
---|---|
protected LineOffset |
addSentence(LineOffset lineOffset,
String processed,
String source,
SentenceExtractor sentenceExtractor,
List<Sentence> sentences)
Add a processed AsciiDoc sentence, using the raw source sentence to guide the character offsets.
|
org.asciidoctor.ast.Document |
process(org.asciidoctor.ast.Document document)
Process a AsciiDoctorJ document
|
protected void |
processParagraph(String paragraph,
String sourceText,
List<Sentence> sentences)
Process a paragraph of processed text.
|
public RedPenTreeProcessor(Document.DocumentBuilder documentBuilder, SentenceExtractor sentenceExtractor, Map<String,Object> config)
documentBuilder
- redpen document buildersentenceExtractor
- redpen sentence extractorconfig
- asciidoctor's configuration mappublic org.asciidoctor.ast.Document process(org.asciidoctor.ast.Document document)
process
in class org.asciidoctor.extension.Treeprocessor
document
- this is an AsciiDoctorJ document, not a redpen documentprotected void processParagraph(String paragraph, String sourceText, List<Sentence> sentences)
paragraph
- the AsciiDoctor processed text, already converted by the RedPen AsciiDoctor backendsourceText
- the raw source textsentences
- A list of sentences discovered in the processed textprotected LineOffset addSentence(LineOffset lineOffset, String processed, String source, SentenceExtractor sentenceExtractor, List<Sentence> sentences)
lineOffset
- the position of this lineprocessed
- the RedPen AsciiDoctor backend processed sentencesource
- the source sentencesentenceExtractor
- our sentence extractorsentences
- a list of sentences to add discovered sentences toCopyright © 2015. All rights reserved.