Package org.eclipse.xtext.xdoc.xdoc

Examples of org.eclipse.xtext.xdoc.xdoc.Document



  @Override
  public void testGenCodeWithLanguage() throws Exception {
    XdocFile file = pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "codeWithLanguageTest.xdoc");
    Document doc = (Document) file.getMainSection();
    generate(doc);
    validate(EXPECTATION_DIR + "codeWithLanguage.html", RESULT_DIR + "mytestmodel.xdoc-0.html");
  }
View Full Code Here


  }

  @Override
  public void testGenCode() throws Exception {
    XdocFile file = pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "codeTest.xdoc");
    Document doc = (Document) file.getMainSection();
    generate(doc);
    validate(EXPECTATION_DIR + "code.html", RESULT_DIR + "mytestmodel.xdoc-0.html");
  }
View Full Code Here

  public void testTwoChapters() throws Exception {
    XtextResourceSet set = get(XtextResourceSet.class);
    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "01-twoChapters.xdoc"), true);
    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "02-twoChapters.xdoc"), true);
    XdocFile file = (XdocFile) getModel((XtextResource)set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "twoChaptersDoc.xdoc"), true));
    Document doc = (Document) file.getMainSection();
    for(int i = 0; i < doc.getChapters().size(); i++) {
      Chapter chapter = doc.getChapters().get(i);
      generate(chapter);
    }
    generate(doc);
    validate(EXPECTATION_DIR + "01-twoChapters.xdoc.html", RESULT_DIR + "01-twoChapters.xdoc.html");
    validate(EXPECTATION_DIR + "02-twoChapters.xdoc.html", RESULT_DIR + "02-twoChapters.xdoc.html");
View Full Code Here

    validate(EXPECTATION_DIR + "02-twoChapters.xdoc.html", RESULT_DIR + "02-twoChapters.xdoc.html");
    validate(EXPECTATION_DIR + "twoChaptersTOC.xml", RESULT_DIR + "toc.xml");
  }

  public void testTwoChaptersDirect() throws Exception {
    Document doc = (Document) pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "twoChapters.xdoc").getMainSection();
    generate(doc);
  }
View Full Code Here

  public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
    TreeIterator<EObject> _allContents = resource.getAllContents();
    Iterable<EObject> _iterable = IteratorExtensions.<EObject>toIterable(_allContents);
    for (final EObject element : _iterable) {
      if ((element instanceof Document)) {
        final Document doc = ((Document) element);
        String _name = doc.getName();
        String _fileName = this.fileName(_name);
        CharSequence _generate = this.generate(doc);
        fsa.generateFile(_fileName, _generate);
      }
    }
View Full Code Here

      }
    }
  }
 
  public void doGenerate(final EObject obj, final IFileSystemAccess fsa) {
    final Document doc = ((Document) obj);
    String _name = doc.getName();
    String _fileName = this.fileName(_name);
    CharSequence _generate = this.generate(doc);
    fsa.generateFile(_fileName, _generate);
  }
View Full Code Here

 
  public Collection<String> defaultLangKeywords(final Set<AbstractSection> sections) {
    Collection<String> _xblockexpression = null;
    {
      Iterable<Document> _filter = Iterables.<Document>filter(sections, Document.class);
      final Document doc = IterableExtensions.<Document>head(_filter);
      EList<LangDef> _langDefs = doc.getLangDefs();
      final Function1<LangDef, Boolean> _function = new Function1<LangDef, Boolean>() {
        public Boolean apply(final LangDef e) {
          String _name = e.getName();
          return Boolean.valueOf(Objects.equal(_name, "__XdocDefaultLanguage__"));
        }
View Full Code Here

    generator.generate(obj, fsa);
  }

  public void testGenerationAllFilesFullHirarchy() throws Exception {
    String resName = "downToSection4Test";
    Document doc = createDocumentFrom(HTML_SRC + resName + ".xdoc");
    generate(doc);
    assertGenerated(doc);
    for (AbstractSection as : doc.getChapters()) {
      generate(as);
      assertGenerated(as);
      for(AbstractSection next: utils.sections(as)){
        generate(next);
        assertGenerated(next);
View Full Code Here

//    String actual = generator.body(doc).toString();
//    assertEquals(expected, actual);
//  }

  public void testToc() throws Exception {
    Document doc = createDocumentFrom(HTML_SRC+ "downToSection4Test.xdoc");
    String expected = "<div class=\"toc\" >\n" +
        "  <ol>\n" +
        "    <li><a href=\"downToSection4Test-0.html\" >bar</a>\n" +
        "    <ol>\n" +
        "      <li><a href=\"downToSection4Test-0-0.html\" >foo</a></li>\n" +
View Full Code Here

    assertEquals(expected, actual);
  }

  @Override
  public void testGenCodeWithLanguage() throws Exception {
    Document document = createDocumentFrom("codeWithLanguageTest.xdoc");
    generate(document);
    assertGenerated(document);
    generate(document.getChapters().get(0));
    assertGenerated(document.getChapters().get(0));
    validate("codeWithLanguageTest.html", name(document.getChapters().get(0)));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.xdoc.xdoc.Document

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.