org.sweble.wikitext.parser.nodes.WtSection.getHeading()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.sweble.wikitext.parser.nodes.WtSection.getHeading()方法的一些代码示例,展示了WtSection.getHeading()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WtSection.getHeading()方法的具体详情如下:
包路径:org.sweble.wikitext.parser.nodes.WtSection
类名称:WtSection
方法名:getHeading

WtSection.getHeading介绍

暂无

代码示例

代码示例来源:origin: marcusklang/wikiforia

public void visit(WtSection s)
{
  //int start = sb.length();
  filterOutput = true;
  expectSectionTitle = true;
  WtHeading heading = s.getHeading();
  iterate(s.getHeading());
  String title = currentSectionTitle;
  expectSectionTitle = false;
  filterOutput = false;
  if(!isInsideFilteredSection()) {
    if(sb.length() > 0) {
      if(sb.charAt(sb.length() -1) != '\n') {
        sb.append("\n\n");
      }
    }
  }
  iterate(s.getBody());
  //int end = sb.length();
  //for(int i = sb.length()-1; i > 0 && sb.charAt(i) == '\n'; i--, end--);
}

代码示例来源:origin: sweble/sweble-wikitext

@Override
public void visit(WtSection n)
{
  dispatch(n.getHeading());
  dispatch(n.getBody());
}

代码示例来源:origin: org.sweble.wikitext/swc-engine

@Override
public void visit(WtSection n)
{
  dispatch(n.getHeading());
  dispatch(n.getBody());
}

代码示例来源:origin: kermitt2/entity-fishing

iterate(s.getHeading());
finishLine();
String title = sb.toString().trim();

代码示例来源:origin: dkpro/dkpro-jwpl

noWrap = true;
iterate(s.getHeading());
finishLine();
String title = sb.toString().trim();

代码示例来源:origin: marcusklang/wikiforia

public void visit(WtSection s)
{
  if (hasNotReadAbstract && sb.length() > 0) {
    parser.textAbstract(context, 0 , sb.length());
    hasNotReadAbstract = false;
  }
  int start = sb.length();
  WtHeading heading = s.getHeading();
  SwebleTextAstWalker textAstWalker = new SwebleTextAstWalker(config);
  currentSectionTitle = ((String)textAstWalker.go(s.getHeading())).trim();
  if(heading.getRtd().getFields().length >= 1 && heading.getRtd().getFields()[0].length >= 1) {
    String startText = heading.getRtd().getFields()[0][0].toString();
    int depth = startText.length();
    if(currentDepth > depth) {
      ArrayList<Integer> deleteThese = new ArrayList<Integer>();
      for(Map.Entry<Integer,String> entry : headers.tailMap(depth, false).entrySet()) {
        deleteThese.add(entry.getKey());
      }
      for(Integer entry : deleteThese)
        headers.remove(entry);
    }
    currentDepth = depth;
    String currentHeading = currentSectionTitle;
    headers.put(depth, currentHeading);
    parser.header(context, depth, currentHeading, headers.values(), start);
  }
  iterate(s.getBody());
}

代码示例来源:origin: sweble/sweble-wikitext

noWrap = true;
iterate(s.getHeading());
finishLine();
String title = sb.toString().trim();

代码示例来源:origin: org.sweble.wikitext/swc-engine

public void visit(WtSection n)
{
  p.indent();
  pt("<h%d><span class=\"mw-headline\" id=\"%s\">%!</span></h%d>",
      n.getLevel(),
      makeSectionTitle(n.getHeading()),
      n.getHeading(),
      n.getLevel());
  p.println();
  dispatch(n.getBody());
}

代码示例来源:origin: sweble/sweble-wikitext

public void visit(WtSection n)
{
  p.indent();
  pt("<h%d><span class=\"mw-headline\" id=\"%s\">%!</span></h%d>",
      n.getLevel(),
      makeSectionTitle(n.getHeading()),
      n.getHeading(),
      n.getLevel());
  p.println();
  dispatch(n.getBody());
}

代码示例来源:origin: org.sweble.wikitext/swc-parser-lazy

private WtNode createSection(WtSection template, boolean suppressRtd)
{
  WtBody body = createBody(
      template.hasBody() ? template.getBody() : null, suppressRtd);
  WtHeading heading = nf.heading(nf.list());
  if (!suppressRtd)
    heading.setRtd(template.getHeading().getRtd());
  else
    heading.suppressRtd();
  return nf.section(template.getLevel(), heading, body);
}

代码示例来源:origin: sweble/sweble-wikitext

public Wom3ElementNode visit(WtSection n)
{
  Wom3Section section = (Wom3Section) genPushWom("section");
  {
    section.setLevel(n.getLevel());
    appendRtd(section, n, 0);
    dispatchAppend(section, n.getHeading());
    appendRtd(section, n, 1);
    dispatchAppend(section, n.getBody());
    appendRtd(section, n, 2);
  }
  return pop(section);
}

代码示例来源:origin: sweble/sweble-wikitext

private WtNode createSection(WtSection template, boolean suppressRtd)
{
  WtBody body = createBody(
      template.hasBody() ? template.getBody() : null, suppressRtd);
  WtHeading heading = nf.heading(nf.list());
  if (!suppressRtd)
    heading.setRtd(template.getHeading().getRtd());
  else
    heading.suppressRtd();
  return nf.section(template.getLevel(), heading, body);
}

代码示例来源:origin: org.sweble.wom3/sweble-wom3-swc-adapter

public Wom3ElementNode visit(WtSection n)
{
  Wom3Section section = (Wom3Section) genPushWom("section");
  {
    section.setLevel(n.getLevel());
    appendRtd(section, n, 0);
    dispatchAppend(section, n.getHeading());
    appendRtd(section, n, 1);
    dispatchAppend(section, n.getBody());
    appendRtd(section, n, 2);
  }
  return pop(section);
}

代码示例来源:origin: org.sweble.wikitext/swc-parser-lazy

if (visitSectionHeading(n.getHeading()))

代码示例来源:origin: sweble/sweble-wikitext

if (visitSectionHeading(n.getHeading()))

相关文章