Search in sources :

Example 1 with HeadingCollectingVisitor

use of com.vladsch.flexmark.ast.util.HeadingCollectingVisitor in project flexmark-java by vsch.

the class TocNodeRenderer method render.

private void render(TocBlock node, NodeRendererContext context, HtmlWriter html) {
    HeadingCollectingVisitor visitor = new HeadingCollectingVisitor();
    List<Heading> headings = visitor.collectAndGetHeadings(node.getDocument());
    if (headings != null) {
        TocOptionsParser optionsParser = new TocOptionsParser();
        TocOptions options = optionsParser.parseOption(node.getStyle(), this.options.withTitle(""), null).getFirst();
        renderTocHeaders(context, html, node, headings, options);
    }
}
Also used : Heading(com.vladsch.flexmark.ast.Heading) HeadingCollectingVisitor(com.vladsch.flexmark.ast.util.HeadingCollectingVisitor)

Example 2 with HeadingCollectingVisitor

use of com.vladsch.flexmark.ast.util.HeadingCollectingVisitor in project flexmark-java by vsch.

the class SimTocNodeRenderer method render.

private void render(SimTocBlock node, NodeRendererContext context, HtmlWriter html) {
    HeadingCollectingVisitor visitor = new HeadingCollectingVisitor();
    List<Heading> headings = visitor.collectAndGetHeadings(node.getDocument());
    if (headings != null) {
        SimTocOptionsParser optionsParser = new SimTocOptionsParser();
        TocOptions options = optionsParser.parseOption(node.getStyle(), this.options, null).getFirst();
        if (node.getTitle().isNotNull()) {
            options = options.withTitle(node.getTitle().unescape());
        }
        renderTocHeaders(context, html, node, headings, options);
    }
}
Also used : Heading(com.vladsch.flexmark.ast.Heading) HeadingCollectingVisitor(com.vladsch.flexmark.ast.util.HeadingCollectingVisitor)

Aggregations

Heading (com.vladsch.flexmark.ast.Heading)2 HeadingCollectingVisitor (com.vladsch.flexmark.ast.util.HeadingCollectingVisitor)2