Package br.com.caelum.tubaina.parser

Examples of br.com.caelum.tubaina.parser.RegexConfigurator


        e.printStackTrace();
        System.exit(-1);
      }
    }

    RegexConfigurator conf = new RegexConfigurator();
    if (latex) {
      List<Tag> tags = conf.read("/regex.properties", "/latex.properties");

      Parser parser = new LatexParser(tags, showNotes, noAnswer);
      LatexGenerator generator = new LatexGenerator(parser, templateDir, noAnswer);
      File file = new File(outputDir, "latex");
      FileUtils.forceMkdir(file);
      try {
        generator.generate(b, file, outputFileName);
      } catch (TubainaException e) {
        LOG.warn(e.getMessage());
      }
    }

    if (html) {
      HtmlParser htmlParser = new HtmlParser(conf.read("/regex.properties", "/html.properties"), noAnswer);
      HtmlGenerator generator = new HtmlGenerator(htmlParser, strictXhtml, templateDir);
      File file = new File(outputDir, "html");
      FileUtils.forceMkdir(file);
      try {
        generator.generate(b, file);
View Full Code Here


  private LatexParser parser;
  private TubainaBuilderData data;

  @Before
  public void setUp() throws IOException {
    RegexConfigurator configurator = new RegexConfigurator();
    List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
    parser = new LatexParser(tags);

    File path = new File("src/test/resources");
    ResourceLocator.initialize(path);
    data = new TubainaBuilderData(false, TubainaBuilder.DEFAULT_TEMPLATE_DIR, false, false, "teste");
View Full Code Here

    }
  }

  @Test
  public void testGeneratorForInstructorTextbook() throws IOException {
    RegexConfigurator configurator = new RegexConfigurator();
    List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
    LatexParser parser = new LatexParser(tags);

    File path = new File("src/test/resources");
    ResourceLocator.initialize(path);
    BookBuilder builder = builder("Do Instrutor");
View Full Code Here

    public void setUp() throws IOException {
        Configuration cfg = new Configuration();
        cfg.setDirectoryForTemplateLoading(new File(TubainaBuilder.DEFAULT_TEMPLATE_DIR, "kindle"));
        cfg.setObjectWrapper(new BeansWrapper());

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

        partToKindle = new PartToKindle(parser, cfg, new ArrayList<String>());
    }
View Full Code Here

        Configuration cfg = new Configuration();
        File templateDir = new File(TubainaBuilder.DEFAULT_TEMPLATE_DIR, "kindle/");
        cfg.setDirectoryForTemplateLoading(templateDir);
        cfg.setObjectWrapper(new BeansWrapper());

        Parser parser = new HtmlParser(new RegexConfigurator().read("/regex.properties",
                "/html.properties"));
       
        ResourceManipulatorFactory kindleResourceManipulatorFactory = new KindleResourceManipulatorFactory();
        File temp = new File("tmp");
        TubainaHtmlDir bookRoot = new TubainaKindleIO(templateDir, kindleResourceManipulatorFactory)
View Full Code Here

    private KindleGenerator generator;
    private File tempDir;

    @Before
    public void setUp() throws IOException {
        RegexConfigurator configurator = new RegexConfigurator();
        List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
        HtmlParser parser = new HtmlParser(tags);

        File path = new File("src/test/resources");
        ResourceLocator.initialize(path);
View Full Code Here

  private HtmlParser parser;
 
  @Before
  public void setUp() throws IOException {
    RegexConfigurator configurator = new RegexConfigurator();
    List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
    this.parser = new HtmlParser(tags);
  }
View Full Code Here

      module = new MockedModule();
        cfg = new Configuration();
        cfg.setDirectoryForTemplateLoading(new File(TubainaBuilder.DEFAULT_TEMPLATE_DIR, "html/"));
        cfg.setObjectWrapper(new BeansWrapper());
       
    RegexConfigurator configurator = new RegexConfigurator();
    List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
    this.parser = new HtmlParser(tags);

        chapterIdentifier = "class=\"indexChapter\"";
        sectionIdentifier = "class=\"indexSection\"";
        introChapterIdentifier = "class=\"chapter";
View Full Code Here

    public void shouldGenerateChapterInsideADiv() throws Exception {
        Configuration cfg = new Configuration();
        cfg.setDirectoryForTemplateLoading(new File(TubainaBuilder.DEFAULT_TEMPLATE_DIR, "singlehtml/"));
        cfg.setObjectWrapper(new BeansWrapper());

        Parser parser = new HtmlParser(new RegexConfigurator().read("/regex.properties", "/html.properties"));

        ArrayList<String> dirTree = new ArrayList<String>();
        dirTree.add("livro");
        dirTree.add("livro/01-capitulo");
        dirTree.add("livro/01-capitulo/01-primeira");
View Full Code Here

    private TubainaBuilderData data;

    @Before
    public void setUp() throws IOException {
        RegexConfigurator configurator = new RegexConfigurator();
        List<RegexTag> tags = configurator.read("/regex.properties", "/html.properties");
        HtmlParser parser = new HtmlParser(tags);

        File path = new File("src/test/resources");
        ResourceLocator.initialize(path);
        data = new TubainaBuilderData(false, TubainaBuilder.DEFAULT_TEMPLATE_DIR, false, false,
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.parser.RegexConfigurator

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.