public void visit(HeaderNode node) { printBreakBeforeTag(node, "h" + node.getLevel()); }
public Rule AtxStart() { return Sequence( FirstOf("######", "#####", "####", "###", "##", "#"), push(new HeaderNode(match().length())) ); }
public void visit(HeaderNode node) { inHeaderNode = true; boolean printHeaderNode = true; for (Node child : node.getChildren()) { if (child instanceof ExpLinkNode) { if (URL_FOR_CONCORDION.equals(((ExpLinkNode) child).url)) { String expression = ((ExpLinkNode)child).title; currentExampleHeading = printChildrenToString(node); currentExampleLevel = node.getLevel(); String exampleName = toExampleName(expression); ConcordionStatement command = statementParser.parseCommandValueAndAttributes("example", exampleName, true); if (node.getLevel() < currentExampleLevel) { closeExample();
if(node instanceof HeaderNode) { HeaderNode headerNode = (HeaderNode)node; int level = headerNode.getLevel(); if(level <= tocLevel) { HEADER_LOOKUP.put(new StartEndBean(headerNode.getStartIndex(), headerNode.getEndIndex()), numHeader);
public void visit(HeaderNode node) { inHeaderNode = true; boolean printHeaderNode = true; for (Node child : node.getChildren()) { if (child instanceof ExpLinkNode) { if (URL_FOR_CONCORDION.equals(((ExpLinkNode) child).url)) { String expression = ((ExpLinkNode)child).title; currentExampleHeading = printChildrenToString(node); currentExampleLevel = node.getLevel(); String exampleName = toExampleName(expression); ConcordionStatement command = statementParser.parseCommandValueAndAttributes("example", exampleName, true); if (node.getLevel() < currentExampleLevel) { closeExample();
@Override public void visit(HeaderNode hn) { _buffer.append( format( "\n\nh%s.", hn.getLevel()) ); visitChildren(hn); _buffer.append("\n\n"); }
public Rule SetextHeading1() { return Sequence( SetextInline(), push(new HeaderNode(1, popAsNode(), true)), ZeroOrMore(SetextInline(), addAsChild()), wrapInAnchor(), Sp(), Newline(), NOrMore('=', 3), Sp(), Newline() ); }
@Override public void visit(HeaderNode hn) { _buffer.append( format( "h%s.", hn.getLevel()) ); visitChildren(hn); _buffer.append("\n\n"); }
public Rule SetextHeading2() { return Sequence( SetextInline(), push(new HeaderNode(2, popAsNode(), true)), ZeroOrMore(SetextInline(), addAsChild()), wrapInAnchor(), Sp(), Newline(), NOrMore('-', 3), Sp(), Newline() ); }
@Override public void visit(HeaderNode hn) { _buffer.append( format( "\n\nh%s.", hn.getLevel()) ); visitChildren(hn); _buffer.append("\n\n"); }
private void dumpProcessor(int depth, Node node, Processor processor) { if (log.isDebugEnabled()) { String indent = indent(depth); StringBuilder out = new StringBuilder(); out.append(indent); if (processor == processorDefault) { out.append(" "); } else { out.append("*"); } out.append(node); if (node instanceof HeaderNode) { out.append(" L:").append(((HeaderNode) node).getLevel()); } if (node instanceof VerbatimNode) { out.append(" T:").append(((VerbatimNode) node).getType()); } if (node instanceof RefImageNode) { RefImageNode rn = (RefImageNode) node; out.append(" separatorSpace: '").append(rn.separatorSpace).append("' refKey: '").append(rn.referenceKey).append("'"); } log.debug(out.toString()); } }
private void appendSection(HeaderNode headerNode) { // 1. remain sentence flush to current section fixSentence(); // 2. retrieve children for header content create; visitChildren(headerNode); List<Sentence> headerContents = createSentenceList(); // To deal with a header content as a paragraph if (headerContents.size() > 0) { headerContents.get(0).setIsFirstSentence(true); } // 3. create new Section Section currentSection = builder.getLastSection(); builder.appendSection(new Section(headerNode.getLevel(), headerContents)); //FIXME move this validate process to addChild if (!addChild(currentSection, builder.getLastSection())) { LOG.warn("Failed to add parent for a Section"); if (builder.getLastSection().getHeaderContents() != null && builder.getLastSection().getHeaderContents().size() > 0) { builder.getLastSection().getHeaderContents().get(0); } } }
public void visit(HeaderNode node) { printer.println().println(); repeat('=', node.getLevel()); printer.print(' '); visitChildren(node); printer.println().println(); }
public void visit(HeaderNode node) { printer.println().println(); repeat('=', node.getLevel()); printer.print(' '); visitChildren(node); printer.println().println(); }
@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); } }