Package br.com.caelum.tubaina

Examples of br.com.caelum.tubaina.SectionsManager


    Parser parser = new HtmlParser(new RegexConfigurator().read("/regex.properties", "/kindle.properties"));
    chapterToString = new ChapterToKindle(parser, cfg);
  }

  private Chapter createChapter(String title, String introduction, String content) {
    return new ChapterBuilder(title, introduction, content, 1, new SectionsManager()).build();
  }
View Full Code Here


        assertTrue(toc.contains("Segunda seção"));
    }


    private Book createBook() {
        BookBuilder builder = new BookBuilder("title", new SectionsManager());
        builder.addReaderFromString(
                "[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("[chapter Introdução]\n"
View Full Code Here

    dirTree.add("livro/01-capitulo/02-segunda");
    sectionToString = new SectionToString(parser, cfg, dirTree);
  }

  private Section createSection(final String sectionText) {
    SectionsManager sectionsManager = new SectionsManager();
    return new SectionBuilder("Title", sectionText, new ArrayList<Resource>(), sectionsManager).build();
  }
View Full Code Here

  }

  @Test
  public void testSection() {
    Section section = createSection("este é o texto da seção");
    Book book = new BookBuilder("livro", new SectionsManager()).build();
    new HtmlModule().inject(book);
    new HtmlModule().inject(section);
    String string = sectionToString.generateSection(book, "capitulo", 7, section, 4, 2).toString();
    Assert.assertEquals(1, countOccurrences(string, "class=\"sectionChapter\">(\\s)*capitulo(\\s)*<"));
    Assert.assertEquals(1, countOccurrences(string, "7.4 - Title"));
View Full Code Here

  }

  @Test
  public void testFlatSection() {
    Section section = createSection("este é o texto da seção");
    Book book = new BookBuilder("livro", new SectionsManager()).build();
    new HtmlModule().inject(book);
    new HtmlModule().inject(section);
   
    String string = sectionToString.generateSection(book, "capitulo", 7, section, 4, 2).toString();
    Assert.assertEquals(1, countOccurrences(string, "class=\"sectionChapter\">(\\s)*capitulo(\\s)*<"));
 
View Full Code Here

        Book b = builder.build();
        generator.generate(b, tempDir);
    }
   
    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.