Java Code Examples for org.commonmark.renderer.html.HtmlRenderer#Builder

The following examples show how to use org.commonmark.renderer.html.HtmlRenderer#Builder . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StrikethroughExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(new HtmlNodeRendererFactory() {
        @Override
        public NodeRenderer create(HtmlNodeRendererContext context) {
            return new StrikethroughHtmlNodeRenderer(context);
        }
    });
}
 
Example 2
Source File: InsExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(new HtmlNodeRendererFactory() {
        @Override
        public NodeRenderer create(HtmlNodeRendererContext context) {
            return new InsHtmlNodeRenderer(context);
        }
    });
}
 
Example 3
Source File: ImageAttributesExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.attributeProviderFactory(new AttributeProviderFactory() {
        @Override
        public AttributeProvider create(AttributeProviderContext context) {
            return ImageAttributesAttributeProvider.create();
        }
    });
}
 
Example 4
Source File: HeadingAnchorExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.attributeProviderFactory(new AttributeProviderFactory() {
        @Override
        public AttributeProvider create(AttributeProviderContext context) {
            return HeadingIdAttributeProvider.create(defaultId, idPrefix, idSuffix);
        }
    });
}
 
Example 5
Source File: TaskListItemsExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(new HtmlNodeRendererFactory() {
        @Override
        public NodeRenderer create(HtmlNodeRendererContext context) {
            return new TaskListItemHtmlNodeRenderer(context);
        }
    });
}
 
Example 6
Source File: TablesExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(new HtmlNodeRendererFactory() {
        @Override
        public NodeRenderer create(HtmlNodeRendererContext context) {
            return new TableHtmlNodeRenderer(context);
        }
    });
}
 
Example 7
Source File: PageTextExtension.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(context -> new PageTextRenderer(context, keywordService));
}
 
Example 8
Source File: EmojiExtension.java    From mvvm-template with GNU General Public License v3.0 4 votes vote down vote up
@Override public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(EmojiNodeRenderer::new);
}
 
Example 9
Source File: MentionExtension.java    From mvvm-template with GNU General Public License v3.0 4 votes vote down vote up
@Override public void extend(HtmlRenderer.Builder rendererBuilder) {
    rendererBuilder.nodeRendererFactory(MentionNodeRenderer::new);
}
 
Example 10
Source File: MarkdownTableExtension.java    From js-dossier with Apache License 2.0 4 votes vote down vote up
@Override
public void extend(HtmlRenderer.Builder builder) {
  builder.nodeRendererFactory(TableBlockHtmlRenderer::new);
}