/**
  * Create a new section renderer
  *
  * @param   SimpleTree  $tree           The documentation tree
  * @param   string|null $chapter        If not null, the chapter to filter for
  *
  * @throws  ChapterNotFoundException    If the chapter to filter for was not found
  */
 public function __construct(SimpleTree $tree, $chapter = null)
 {
     if ($chapter !== null) {
         $filter = new DocSectionFilterIterator($tree->getIterator(), $chapter);
         if ($filter->isEmpty()) {
             throw new ChapterNotFoundException(mt('doc', 'Chapter %s not found'), $chapter);
         }
         parent::__construct($filter, RecursiveIteratorIterator::SELF_FIRST);
     } else {
         parent::__construct($tree->getIterator(), RecursiveIteratorIterator::SELF_FIRST);
     }
     $this->tree = $tree;
     $this->parsedown = Parsedown::instance();
 }
Beispiel #2
0
 /**
  * Create a new toc renderer
  *
  * @param TreeNodeIterator $iterator
  */
 public function __construct(TreeNodeIterator $iterator)
 {
     parent::__construct($iterator, RecursiveIteratorIterator::SELF_FIRST);
 }
 /**
  * Create a new renderer for doc searches
  *
  * @param DocSearchIterator $iterator
  */
 public function __construct(DocSearchIterator $iterator)
 {
     parent::__construct($iterator, RecursiveIteratorIterator::SELF_FIRST);
 }