Search in sources :

Example 1 with SourceBlocks

use of org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks in project mylyn.docs by eclipse.

the class CommonMarkLanguage method processContent.

@Override
public void processContent(MarkupParser parser, String markupContent, boolean asDocument) {
    checkNotNull(parser);
    checkNotNull(markupContent);
    DocumentBuilder builder = checkNotNull(parser.getBuilder());
    if (asDocument) {
        builder.beginDocument();
    }
    SourceBlocks sourceBlocks = CommonMark.sourceBlocks();
    ProcessingContext context = createContext(sourceBlocks, markupContent);
    sourceBlocks.process(context, builder, LineSequence.create(markupContent));
    if (asDocument) {
        builder.endDocument();
    }
}
Also used : ProcessingContext(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) SourceBlocks(org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)

Example 2 with SourceBlocks

use of org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks in project mylyn.docs by eclipse.

the class BlockQuoteBlock method process.

@Override
public void process(ProcessingContext context, DocumentBuilder builder, LineSequence lineSequence) {
    builder.setLocator(lineSequence.getCurrentLine().toLocator());
    builder.beginBlock(BlockType.QUOTE, new Attributes());
    SourceBlocks sourceBlocks = CommonMark.sourceBlocks();
    BlockQuoteState blockQuoteState = new BlockQuoteState();
    sourceBlocks.process(context, builder, blockQuoteState.blockQuoteLineSequence(lineSequence), blockQuoteState.contextPredicate());
    builder.endBlock();
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SourceBlocks(org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)

Example 3 with SourceBlocks

use of org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks in project mylyn.docs by eclipse.

the class BlockQuoteBlock method createContext.

@Override
public void createContext(ProcessingContextBuilder contextBuilder, LineSequence lineSequence) {
    SourceBlocks sourceBlocks = CommonMark.sourceBlocks();
    BlockQuoteState blockQuoteState = new BlockQuoteState();
    sourceBlocks.createContext(contextBuilder, blockQuoteState.blockQuoteLineSequence(lineSequence), blockQuoteState.contextPredicate());
}
Also used : SourceBlocks(org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)

Aggregations

SourceBlocks (org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)3 ProcessingContext (org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext)1 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)1 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)1