Skip to content

Commit

Permalink
Merge pull request #397 from robertpanzer/slim_3.0.6
Browse files Browse the repository at this point in the history
Bump slim to 3.0.6
  • Loading branch information
robertpanzer committed Nov 2, 2015
2 parents 732a240 + 0bcb98b commit e0a3921
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.asciidoctor;

import org.asciidoctor.util.ClasspathResources;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class WhenSlimTemplatesAreUsed {

@Rule
public ClasspathResources classpath = new ClasspathResources();

private Asciidoctor asciidoctor = Asciidoctor.Factory.create();

@Test
public void the_slim_paragraph_template_should_be_used_when_rendering_a_document_inline() throws Exception {

Options options = OptionsBuilder.options().templateDir(classpath.getResource("src/custom-backends/slim")).toFile(false).headerFooter(false).get();

String sourceDocument = "= Hello World\n" +
"\n" +
"This will be replaced by static content from the template";

String renderContent = asciidoctor.render(sourceDocument, options);

Element doc = Jsoup.parse(renderContent, "UTF-8");
Element paragraph = doc.select("p").first();
assertEquals("This is static content", paragraph.text());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p This is static content
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ext {
openUriCachedGemVersion = '0.0.5'
prawnGemVersion = '1.3.0'
rougeGemVersion = '1.9.1'
slimGemVersion = '2.0.3'
slimGemVersion = '3.0.6'
threadSafeGemVersion = '0.3.5'
tiltGemVersion = '2.0.1'
ttfunkGemVersion = '1.2.2'
Expand Down

0 comments on commit e0a3921

Please sign in to comment.