Package br.com.caelum.tubaina.util

Examples of br.com.caelum.tubaina.util.HtmlSanitizer


  public StringBuffer createFlatIndex(final Map<String, Integer> indexes, Book book) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("dirTree", dirTree);
    map.put("book", book);
    map.put("indexes", indexes);
    map.put("sanitizer", new HtmlSanitizer());
    return new FreemarkerProcessor(cfg).process(map, "index-flat.ftl");
  }
View Full Code Here


    map.put("chapter", c);
    map.put("curchap", index);
    map.put("curdir", currentDir);
    map.put("parser", parser);
    map.put("dirTree", dirTree);
    map.put("sanitizer", new HtmlSanitizer());
    map.put("previous", dirTree.get(currentDir - 1));
    if (currentDir+1 < dirTree.size()) {
      map.put("next", dirTree.get(currentDir + 1))
    } else {
      map.put("next", "");
View Full Code Here

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("book", book);
        map.put("chapter", chapter);
        map.put("allSectionsContent", allSectionsContent);
        map.put("parser", parser);
        map.put("sanitizer", new HtmlSanitizer());
        return new FreemarkerProcessor(cfg).process(map, "chapter.ftl");
    }
View Full Code Here

    }

    public StringBuffer generateTOC() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("book", book);
        map.put("sanitizer", new HtmlSanitizer());
        return new FreemarkerProcessor(cfg).process(map, "toc.ftl");
    }
View Full Code Here

    map.put("parser", parser);
    map.put("book", b);
    map.put("chapters", b.getChapters());
    map.put("dirTree", dirTree);
    map.put("textbookVersion", new VersionGenerator().generate());
    map.put("sanitizer", new HtmlSanitizer());

    return new FreemarkerProcessor(cfg).process(map, "toc.ftl");
  }
View Full Code Here

        }
        map.put("part", part);
        map.put("parser", parser);
        map.put("partNumber", partNumber);
        map.put("chaptersContent", chaptersContent.toString());
        map.put("sanitizer", new HtmlSanitizer());
        StringBuffer processedContent = new FreemarkerProcessor(cfg).process(map, "bookPart.ftl");
        String sluggedPartTitle = Utilities.toDirectoryName(null, part.getTitle());
        processedContent = new StringBuffer(processedContent.toString().replace("$$RELATIVE$$", sluggedPartTitle));
        return processedContent;
    }
View Full Code Here

    public StringBuffer generateKindleHtmlChapter(Chapter chapter) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("chapter", chapter);
        map.put("parser", parser);
        map.put("sanitizer", new HtmlSanitizer());
        return new FreemarkerProcessor(cfg).process(map, "chapter.ftl");
    }
View Full Code Here

   
    Pattern description = Pattern.compile("(?s)(?i)\"(.+?)\"");
    Matcher descriptionMatcher = description.matcher(options);
    // The image is resized when copied
    if (descriptionMatcher.find()) {
      String subtitle = new HtmlSanitizer().sanitize(descriptionMatcher.group(1));
      output.append("alt=\"" + subtitle + "\" />");
      subtitle = parser.parse(subtitle);
      output.append("\n<div><i>Fig. " + chunk.getChapterNumber()
          + "." + chunk.getImageNumber() + ": " +  subtitle +"</i></div><br><br>");
    } else {
View Full Code Here

    }
   
    public String generateIntroductionChapters(List<Chapter> chapters) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("parser", parser);
        map.put("sanitizer", new HtmlSanitizer());
        map.put("chapters", chapters);
        for (Chapter chapter : chapters) {
            bookRoot.cd(Utilities.toDirectoryName(RESOURCES_PATH)).writeResources(
                    chapter.getResources());
        }
View Full Code Here

            map.put(ifdef, true);
        }
        map.put("book", book);
        map.put("chapter", chapter);
        map.put("parser", parser);
        map.put("sanitizer", new HtmlSanitizer());
        return new FreemarkerProcessor(cfg).process(map, "chapter.ftl");
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.util.HtmlSanitizer

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.