Package br.com.caelum.tubaina

Examples of br.com.caelum.tubaina.SectionsManager


    this.replacerType = replacerType;
    this.sectionsManager = sectionsManager;
  }
 
  public ChunkSplitter(List<Resource> resources, String replacerType) {
    this(resources, replacerType, new SectionsManager());
  }
View Full Code Here


public class ImageTagTest extends AbstractTagTest {

  @Test(expected=TubainaException.class)
  public void shouldThrowExceptionWhenTagContainsLabel() {
    ImageChunk chunk = new ImageChunk("image.png", "label=someLabel", 100, 1, new SectionsManager());
    getContent(chunk);
  }
View Full Code Here

        chapterIdentifier = "class=\"indexChapter\"";
        sectionIdentifier = "class=\"indexSection\"";
        introChapterIdentifier = "class=\"chapter";
        introSectionIdentifier = "class=\"section";
        builder = new BookBuilder("Title", new SectionsManager());
    }
View Full Code Here

public class SubsectionTagTest extends AbstractTagTest{
 
  @Test
  public void shouldParseSubsectionChunk() {
    SubsectionTag subsectionTag = new SubsectionTag(new SectionsManager());
    SubsectionChunk chunk = new SubsectionChunk("title", text("content"), 1, 1, 1);
    String parsed = subsectionTag.parse(chunk);
    assertEquals("<"+SubsectionTag.HTML_TAG+" class='subsection'>1.1.1 - title</"+SubsectionTag.HTML_TAG+">\ncontent", parsed);
  }
View Full Code Here

    assertEquals("<"+SubsectionTag.HTML_TAG+" class='subsection'>1.1.1 - title</"+SubsectionTag.HTML_TAG+">\ncontent", parsed);
  }
 
  @Test
  public void shouldParseSubsectionChunkSanitized() {
    SubsectionTag subsectionTag = new SubsectionTag(new SectionsManager());
    SubsectionChunk chunk = new SubsectionChunk("éáçãà", text("content"), 1, 1, 1);
    String parsed = subsectionTag.parse(chunk);
    assertEquals("<"+SubsectionTag.HTML_TAG+" class='subsection'>1.1.1 - &eacute;&aacute;&ccedil;&atilde;&agrave;</"+SubsectionTag.HTML_TAG+">\ncontent", parsed);
  }
View Full Code Here

import freemarker.template.Configuration;

public class SingleHtmlChapterGeneratorTest {
   
    private Chapter createChapter(final String introduction, final String chapterText) {
        return new ChapterBuilder("Title", introduction, chapterText, 0, new SectionsManager()).build();
    }
View Full Code Here

        SingleHtmlChapterGenerator singleHtmlChapterGenerator = new SingleHtmlChapterGenerator(parser, cfg, new ArrayList<String>());
       
        Chapter c = createChapter("introducao", "[section primeira] conteudo da primeira "
                + "\n[section segunda] conteudo da segunda");
       
        Book book = new BookBuilder("some name", new SectionsManager()).build();
        new HtmlModule().inject(book);
        new HtmlModule().inject(c);
       
    String string = singleHtmlChapterGenerator.generateSingleHtmlChapter(book, c).toString();
       
View Full Code Here

        File introduction = new File(livro, "introduction");
        Assert.assertFalse(introduction.exists());
    }
   
    public BookBuilder builder(String title) {
      return new BookBuilder(title, new SectionsManager());
    }
View Full Code Here

    assertTrue("should contain directory with chosen book name", bookRoot.exists());
    assertTrue("should contain includes directory", includes.exists());
  }

  private Book createsSimpleBookWithTitle(String title) {
    BookBuilder builder = new BookBuilder(title, new SectionsManager());

    String fileContent = "[chapter     O que é java?   ]\n" + "texto da seção\n" + "[section Primeira seção]\n"
        + "texto da prim seção\n" + "[section Segunda seção]\n" + "texto da segunda seção\n\n";
    builder.addReaderFromString(fileContent);
View Full Code Here

    assertTrue(secondChapter.exists());
    assertTrue(secondChaptersImage.exists());
  }

  private BookBuilder builder(String title) {
    return new BookBuilder(title, new SectionsManager());
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.SectionsManager

Copyright © 2018 www.massapicom. 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.