# Class yii\apidoc\helpers\IndexFileAnalyzer

Inheritance | yii\apidoc\helpers\IndexFileAnalyzer » cebe\markdown\Markdown
Source Code | https://github.com/yiisoft/yii2-apidoc/blob/master/helpers/IndexFileAnalyzer.php

IndexFileAnalyzer analyzes index file with TOC. Typically README.md.

## Public Properties

Hide inherited properties

Property | Type | Description | Defined By
--- | --- | --- | ---
$introduction |  |  | yii\apidoc\helpers\IndexFileAnalyzer
$title |  |  | yii\apidoc\helpers\IndexFileAnalyzer

## Public Methods

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
analyze() | Parses text and returns list of chapters got from it | yii\apidoc\helpers\IndexFileAnalyzer

## Protected Methods

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
renderHeadline() |  | yii\apidoc\helpers\IndexFileAnalyzer
renderList() |  | yii\apidoc\helpers\IndexFileAnalyzer
renderParagraph() |  | yii\apidoc\helpers\IndexFileAnalyzer

## Property Details

Hide inherited properties

$introduction public property
public $introduction = null
$title public property
public $title = null

## Method Details

Hide inherited methods

analyze() public method

Parses text and returns list of chapters got from it

public array analyze ( $text )
$text | string |

Source code

                    public function analyze($text)
    {
        $this->parse($text);
        return $this->_chapters;
    }

renderHeadline() protected method

protected void renderHeadline ( $block )
$block |  |

Source code

                    protected function renderHeadline($block)
    {
        if ($this->_chapter === 0) {
            $this->title = $this->renderAbsy($block['content']);
            $this->introduction = '';
            $this->_chapter++;
        } else {
            $this->_chapter++;
            $this->_chapters[$this->_chapter] = [
                'headline' => $this->renderAbsy($block['content']),
                'content' => [],
            ];
        }
        return parent::renderHeadline($block);
    }

renderList() protected method

protected void renderList ( $block )
$block |  |

Source code

                    protected function renderList($block)
    {
        if ($this->_chapter > 0) {
            foreach ($block['items'] as $item => $absyElements) {
                foreach($absyElements as $element) {
                    if ($element[0] === 'link') {
                        $this->_chapters[$this->_chapter]['content'][] = [
                            'headline' => $this->renderAbsy($element['text']),
                            'file' => $element['url'],
                        ];
                    }
                }
            }
        }
        return parent::renderList($block);
    }

renderParagraph() protected method

protected void renderParagraph ( $block )
$block |  |

Source code

                    protected function renderParagraph($block)
    {
        if ($this->_chapter < 1) {
            $this->introduction .= $this->renderAbsy($block['content']);
        }
        return parent::renderParagraph($block);
    }