Examples of MarkupToEclipseToc


Examples of org.eclipse.mylyn.wikitext.core.parser.util.MarkupToEclipseToc

        throw new BuildException(String.format("Cannot write to file '%s': %s", tocOutputFile, e.getMessage()), //$NON-NLS-1$
            e);
      }
      try {

        MarkupToEclipseToc toEclipseToc = new SplittingMarkupToEclipseToc();

        toEclipseToc.setHelpPrefix(helpPrefix);
        System.out.println("Help: " + baseDir + " " + htmlOutputFile); //$NON-NLS-1$//$NON-NLS-2$
        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("/")) { //$NON-NLS-1$
            filePath = filePath.substring(1);
          }
          if (filePath.lastIndexOf('/') != -1) {
            String relativePart = filePath.substring(0, filePath.lastIndexOf('/'));
            toEclipseToc.setHelpPrefix(helpPrefix == null ? relativePart : helpPrefix + '/' + relativePart);
          }
        }

        toEclipseToc.setHtmlFile(htmlOutputFile.getName());

        String tocXml = toEclipseToc.createToc(item);

        try {
          writer.write(tocXml);
        } catch (Exception e) {
          throw new BuildException(String.format("Cannot write to file '%s': %s", tocXml, e.getMessage()), e); //$NON-NLS-1$
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.