original_string: public function render_category(category $category) {
          $classes = $category->classes;
          if (empty($classes)) {
              $return = \html_writer::start_tag('section', array('class' => 'node_category'));
          } else {
              $return = \html_writer::start_tag('section', array('class' => 'node_category ' . $classes));
          }
          $return .= \html_writer::tag('h3', $category->title);
          $nodes = $category->nodes;
          if (empty($nodes)) {
              // No nodes, nothing to render.
              return '';
          }
          $return .= \html_writer::start_tag('ul');
          foreach ($nodes as $node) {
              $return .= $this->render($node);
          }
          $return .= \html_writer::end_tag('ul');
          $return .= \html_writer::end_tag('section');
          return $return;
      }
code: public function render_category(category $category) {
          $classes = $category->classes;
          if (empty($classes)) {
              $return = \html_writer::start_tag('section', array('class' => 'node_category'));
          } else {
              $return = \html_writer::start_tag('section', array('class' => 'node_category ' . $classes));
          }
          $return .= \html_writer::tag('h3', $category->title);
          $nodes = $category->nodes;
          if (empty($nodes)) {
              // No nodes, nothing to render.
              return '';
          }
          $return .= \html_writer::start_tag('ul');
          foreach ($nodes as $node) {
              $return .= $this->render($node);
          }
          $return .= \html_writer::end_tag('ul');
          $return .= \html_writer::end_tag('section');
          return $return;
      }
code_tokens: public function render_category ( category $ category ) { $ classes = $ category -> classes ; if ( empty ( $ classes ) ) { $ return = \ html_writer :: start_tag ( 'section' , array ( 'class' => 'node_category' ) ) ; } else { $ return = \ html_writer :: start_tag ( 'section' , array ( 'class' => 'node_category ' . $ classes ) ) ; } $ return .= \ html_writer :: tag ( 'h3' , $ category -> title ) ; $ nodes = $ category -> nodes ; if ( empty ( $ nodes ) ) { // No nodes, nothing to render. return '' ; } $ return .= \ html_writer :: start_tag ( 'ul' ) ; foreach ( $ nodes as $ node ) { $ return .= $ this -> render ( $ node ) ; } $ return .= \ html_writer :: end_tag ( 'ul' ) ; $ return .= \ html_writer :: end_tag ( 'section' ) ; return $ return ; }
docstring: Render a category.
  
  @param category $category
  
  @return string
docstring_tokens: Render a category .