Search in sources :

Example 1 with ProcessingContextBuilder

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

the class CommonMarkLanguage method createContext.

private ProcessingContext createContext(SourceBlocks sourceBlocks, String markupContent) {
    ProcessingContextBuilder contextBuilder = ProcessingContext.builder().idGenerationStrategy(getIdGenerationStrategy());
    if (!strictlyConforming) {
        contextBuilder.inlineParser(InlineContent.markdown());
    }
    sourceBlocks.createContext(contextBuilder, LineSequence.create(markupContent));
    return contextBuilder.build();
}
Also used : ProcessingContextBuilder(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContextBuilder)

Example 2 with ProcessingContextBuilder

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

the class InlineTest method createContext.

@Test
public void createContext() {
    ProcessingContextBuilder builder = ProcessingContext.builder();
    new Inline(new Line(1, 2, "text"), 0, 1) {

        @Override
        public void emit(DocumentBuilder builder) {
        }
    }.createContext(builder);
    ProcessingContext context = builder.build();
    assertTrue(context.isEmpty());
}
Also used : Line(org.eclipse.mylyn.wikitext.commonmark.internal.Line) ProcessingContext(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) ProcessingContextBuilder(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContextBuilder) Test(org.junit.Test)

Aggregations

ProcessingContextBuilder (org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContextBuilder)2 Line (org.eclipse.mylyn.wikitext.commonmark.internal.Line)1 ProcessingContext (org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext)1 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)1 Test (org.junit.Test)1