Package org.eclipse.mylyn.wikitext.core.parser.outline

Examples of org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem


      if (markupContent == null) {
        markupContent = readFully(source);
      }
      performValidation(source, markupContent);

      OutlineItem outline = new OutlineParser(markupLanguage).parse(markupContent);

      Writer writer;
      try {
        writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(outputFile)), "utf-8"); //$NON-NLS-1$
      } catch (Exception e) {
        throw new BuildException(MessageFormat.format(Messages.getString("MarkupToDitaTask.11"), outputFile, //$NON-NLS-1$
            e.getMessage()), e);
      }
      try {
        if (topicStrategy == BreakStrategy.NONE) {
          DitaTopicDocumentBuilder builder = new DitaTopicDocumentBuilder(new DefaultXmlStreamWriter(writer),
              formatting);
          builder.setRootTopicTitle(bookTitle);

          MarkupParser parser = new MarkupParser();
          parser.setMarkupLanguage(markupLanguage);
          parser.setBuilder(builder);
          if (topicDoctype != null) {
            builder.setDoctype(topicDoctype);
          }
          builder.setFilename(outputFile.getName());
          builder.setOutline(outline);

          parser.parse(markupContent);
        } else {
          DitaBookMapDocumentBuilder builder = new DitaBookMapDocumentBuilder(
              formatting ? new FormattingXMLStreamWriter(new DefaultXmlStreamWriter(writer))
                  : new DefaultXmlStreamWriter(writer));
          try {
            builder.setFormattingDependencies(formatting);

            MarkupParser parser = new MarkupParser();
            parser.setMarkupLanguage(markupLanguage);
            parser.setBuilder(builder);

            builder.setBookTitle(bookTitle == null ? name : bookTitle);

            if (doctype != null) {
              builder.setDoctype(doctype);
            }
            if (topicDoctype != null) {
              builder.setTopicDoctype(topicDoctype);
            }
            builder.setTargetFile(outputFile);
            builder.setTopicFolder(topicFolder);
            builder.setOutline(outline);
            switch (topicStrategy) {
            case FIRST:
              if (!outline.getChildren().isEmpty()) {
                builder.setTopicBreakLevel(outline.getChildren().get(0).getLevel());
              } else {
                builder.setTopicBreakLevel(1);
              }
              break;
            case LEVEL1:
View Full Code Here

TOP

Related Classes of org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem

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.