本文整理汇总了Java中org.pegdown.ast.HeaderNode类的典型用法代码示例。如果您正苦于以下问题:Java HeaderNode类的具体用法?Java HeaderNode怎么用?Java HeaderNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HeaderNode类属于org.pegdown.ast包,在下文中一共展示了HeaderNode类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
HeaderNode hNode = (HeaderNode) node;
int hLevel = hNode.getLevel();
Sections sections = context.iTextContext().sections();
Font font = sections.sectionTitlePrimaryFont(hLevel);
context.pushFont(font);
List<Element> subs = context.collectChildren(level, node);
context.popFont();
Paragraph p = new Paragraph();
p.setFont(font);
p.addAll(subs);
Element element = sections.newSection(p, hLevel);
context.append(element);
}
示例2: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(HeaderNode node) {
String tag = "h" + node.getLevel();
String title = printChildrenToString(node);
LinkRenderer.Rendering anchorLink = createAnchorLink(title);
printer.print('<').print(tag).print('>');
printLink(anchorLink);
visitChildren(node);
printer.print('<').print('/').print(tag).print('>');
}
示例3: loadTitle
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
private void loadTitle() {
rootNode.accept(new CollectTextVisitor() {
@Override
public void visit(HeaderNode node) {
printer = new Printer();
visit((SuperNode) node);
title = printer.getString();
printer = null;
exit = true;
}
});
}
示例4: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(HeaderNode header) {
styles.add("h"+header.getLevel());
visitChildren(header);
this.parent.addChild(new Text("\n"));
}
示例5: typeCode
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
private static String typeCode(final Node node) {
final String type = node.toString().split(" ", 2)[0];
if (node instanceof HeaderNode) {
return String.format("%s#%d", type, ((HeaderNode)node).getLevel());
} else if (node instanceof SimpleNode) {
return String.format("%s#%s", type, ((SimpleNode)node).getType());
} else {
return type;
}
}
示例6: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
public void visit(final HeaderNode node) {
visitChildren(node);
}
示例7: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(HeaderNode hn) {
_buffer.append( format( "\n\nh%s.", hn.getLevel()) );
visitChildren(hn);
_buffer.append("\n\n");
}
示例8: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override public void visit(HeaderNode node) {
//To change body of implemented methods use File | Settings | File Templates.
}
示例9: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(HeaderNode headerNode) {
handleNodeGroup(headerNode, String.format("markdroid_header_%d", headerNode.getLevel()));
}
示例10: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
/**
* Accept header node.
* <p>
* Treat header as single paragraph.
* </p>
* @param node header node.
*/
@Override
public void visit(final HeaderNode node) {
handler.startPara(node.getStartIndex(), MarkdownState.NORMAL);
visitChildren(node);
handler.endPara();
}
示例11: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(HeaderNode node) {
}
示例12: visit
import org.pegdown.ast.HeaderNode; //导入依赖的package包/类
@Override
public void visit(@NotNull HeaderNode node) {
}