use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testTable.
@Test
public void testTable() {
builder.beginDocument();
builder.beginBlock(BlockType.TABLE, new Attributes());
builder.beginBlock(BlockType.TABLE_ROW, new Attributes());
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell 1");
builder.endBlock();
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell 2");
builder.endBlock();
builder.endBlock();
builder.beginBlock(BlockType.TABLE_ROW, new Attributes());
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell a");
builder.endBlock();
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell b");
builder.endBlock();
builder.endBlock();
builder.beginBlock(BlockType.TABLE_ROW, new Attributes());
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell A");
builder.endBlock();
builder.beginBlock(BlockType.TABLE_CELL_NORMAL, new Attributes());
builder.characters("cell B");
builder.endBlock();
builder.endBlock();
builder.endBlock();
builder.endDocument();
assertMarkup("|===\n|cell 1 |cell 2 \n\n|cell a |cell b \n\n|cell A |cell B \n|===\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testCodeBlockConsecutive.
@Test
public void testCodeBlockConsecutive() {
builder.beginDocument();
builder.beginBlock(BlockType.CODE, new Attributes());
builder.characters("// comment");
builder.endBlock();
builder.beginBlock(BlockType.CODE, new Attributes());
builder.characters("code();");
builder.endBlock();
builder.endDocument();
assertMarkup("[listing]\n----\n// comment\n----\n\n[listing]\n----\ncode();\n----\n\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testSuperscript.
@Test
public void testSuperscript() {
builder.beginDocument();
builder.beginSpan(SpanType.SUPERSCRIPT, new Attributes());
builder.characters("superscript");
builder.endSpan();
builder.endDocument();
assertMarkup("^superscript^\n\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testHighlight.
@Test
public void testHighlight() {
builder.beginDocument();
builder.beginSpan(SpanType.MARK, new Attributes());
builder.characters("highlight");
builder.endSpan();
builder.endDocument();
assertMarkup("#highlight#\n\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testImageImplicitParagraph.
@Test
public void testImageImplicitParagraph() {
builder.beginDocument();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("Below is an image:");
builder.endBlock();
builder.image(new ImageAttributes(), "/path/to/img.jpg");
builder.endDocument();
assertMarkup("Below is an image:\n\nimage:/path/to/img.jpg[]\n\n");
}
Aggregations