Package net.java.textilej.parser.util

Examples of net.java.textilej.parser.util.TextileToEclipseToc


      } catch (Exception e) {
        throw new BuildException(String.format("Cannot write to file '%s': %s",tocOutputFile,e.getMessage()),e);
      }
      try {
       
        TextileToEclipseToc toEclipseToc = new TextileToEclipseToc();
        toEclipseToc.setBookTitle(name);
       
        String basePath = baseDir.getAbsolutePath().replace('\\','/');
        String outputFilePath = htmlOutputFile.getAbsolutePath().replace('\\','/');
        if (outputFilePath.startsWith(basePath)) {
          String filePath = outputFilePath.substring(basePath.length());
          if (filePath.startsWith("/")) {
            filePath = filePath.substring(1);
          }
          toEclipseToc.setHtmlFile(filePath);
        } else {
          toEclipseToc.setHtmlFile(htmlOutputFile.getName());
        }
       
        String tocXml = toEclipseToc.parse(textile);
       
        try {
          writer.write(tocXml);
        } catch (Exception e) {
          throw new BuildException(String.format("Cannot write to file '%s': %s",tocXml,e.getMessage()),e);
View Full Code Here


      } catch (Exception e) {
        throw new BuildException(String.format("Cannot write to file '%s': %s",tocOutputFile,e.getMessage()),e);
      }
      try {
       
        TextileToEclipseToc toEclipseToc = new TextileToEclipseToc();
        toEclipseToc.setBookTitle(title==null?name:title);
       
        String basePath = baseDir.getAbsolutePath().replace('\\','/');
        String outputFilePath = htmlOutputFile.getAbsolutePath().replace('\\','/');
        if (outputFilePath.startsWith(basePath)) {
          String filePath = outputFilePath.substring(basePath.length());
          if (filePath.startsWith("/")) {
            filePath = filePath.substring(1);
          }
          toEclipseToc.setHtmlFile(filePath);
        } else {
          toEclipseToc.setHtmlFile(htmlOutputFile.getName());
        }
       
        String tocXml = toEclipseToc.parse(textile);
       
        try {
          writer.write(tocXml);
        } catch (Exception e) {
          throw new BuildException(String.format("Cannot write to file '%s': %s",tocXml,e.getMessage()),e);
View Full Code Here

TOP

Related Classes of net.java.textilej.parser.util.TextileToEclipseToc

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.