Package org.asciidoctor

Source Code of org.asciidoctor.WhenCustomTemplatesAreUsed

package org.asciidoctor;

import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.asciidoctor.OptionsBuilder.options;

import java.io.File;

import org.asciidoctor.internal.JRubyAsciidoctor;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.junit.Test;

public class WhenCustomTemplatesAreUsed {

    private Asciidoctor asciidoctor = JRubyAsciidoctor.create();
   
    @Test
    public void document_should_be_rendered_using_given_template_dir() {
       
        Options options = options().templateDir(new File("target/test-classes/src/custom-backends/haml/html5-tweaks")).toFile(false).get();
        String renderContent = asciidoctor.renderFile(new File("target/test-classes/rendersample.asciidoc"), options);
       
        Document doc = Jsoup.parse(renderContent, "UTF-8");
        Element paragraph = doc.select("div.content").first();
        assertThat(paragraph, notNullValue());
    }
   
}
TOP

Related Classes of org.asciidoctor.WhenCustomTemplatesAreUsed

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.