robot-core/src/main/java/org/obolibrary/robot/ExplainOperation.java
private static String renderTree(Tree<OWLAxiom> tree, OWLObjectRenderer renderer) {
    StringBuilder builder = new StringBuilder();
    if (tree.isRoot()) {
      builder.append("## ");
      builder.append(renderer.render(tree.getUserObject()));
      builder.append(" ##");
      builder.append("\n");
    } else {
      String padding =
          tree.getPathToRoot().stream().skip(1).map(x -> "  ").collect(Collectors.joining());
      builder.append(padding);
      builder.append("- ");
      builder.append(renderer.render(tree.getUserObject()));
    }
    if (!tree.isLeaf()) builder.append("\n");
    String children =
        tree.getChildren()
            .stream()
            .map(child -> renderTree(child, renderer))
            .collect(Collectors.joining("\n"));
    builder.append(children);
    return builder.toString();
  }
/**
   * Render axiom tree in indented Markdown using the provided renderer.
   *
   * @param tree indented collection of axioms
   * @param renderer renderer for displaying axioms and entities
   * @return
   */
Render axiom tree in indented Markdown using the provided renderer.
@param tree indented collection of axioms
@param renderer renderer for displaying axioms and entities
@return
Render axiom tree in indented Markdown using the provided renderer . @param tree indented collection of axioms @param renderer renderer for displaying axioms and entities @return
private static String renderTree(Tree<OWLAxiom> tree, OWLObjectRenderer renderer) {
    StringBuilder builder = new StringBuilder();
    if (tree.isRoot()) {
      builder.append("## ");
      builder.append(renderer.render(tree.getUserObject()));
      builder.append(" ##");
      builder.append("\n");
    } else {
      String padding =
          tree.getPathToRoot().stream().skip(1).map(x -> "  ").collect(Collectors.joining());
      builder.append(padding);
      builder.append("- ");
      builder.append(renderer.render(tree.getUserObject()));
    }
    if (!tree.isLeaf()) builder.append("\n");
    String children =
        tree.getChildren()
            .stream()
            .map(child -> renderTree(child, renderer))
            .collect(Collectors.joining("\n"));
    builder.append(children);
    return builder.toString();
  }
private static String renderTree ( Tree < OWLAxiom > tree , OWLObjectRenderer renderer ) { StringBuilder builder = new StringBuilder ( ) ; if ( tree . isRoot ( ) ) { builder . append ( "## " ) ; builder . append ( renderer . render ( tree . getUserObject ( ) ) ) ; builder . append ( " ##" ) ; builder . append ( "\n" ) ; } else { String padding = tree . getPathToRoot ( ) . stream ( ) . skip ( 1 ) . map ( x -> "  " ) . collect ( Collectors . joining ( ) ) ; builder . append ( padding ) ; builder . append ( "- " ) ; builder . append ( renderer . render ( tree . getUserObject ( ) ) ) ; } if ( ! tree . isLeaf ( ) ) builder . append ( "\n" ) ; String children = tree . getChildren ( ) . stream ( ) . map ( child -> renderTree ( child , renderer ) ) . collect ( Collectors . joining ( "\n" ) ) ; builder . append ( children ) ; return builder . toString ( ) ; }
Render axiom tree in indented Markdown using the provided renderer.
Render axiom tree in indented Markdown using the provided renderer .