renderers/GuideRenderer.php
protected function loadGuideStructure($files)
    {
        $chapters = [];
        foreach ($files as $file) {
            $contents = file_get_contents($file);
            if (basename($file) == 'README.md') {
                $indexAnalyzer = new IndexFileAnalyzer();
                $chapters = $indexAnalyzer->analyze($contents);
                break;
            }
            if (preg_match("/^(.*)\n=+/", $contents, $matches)) {
                $headlines[$file] = $matches[1];
            } else {
                $headlines[$file] = basename($file);
            }

        }
        return $chapters;
    }
protected function loadGuideStructure($files)
    {
        $chapters = [];
        foreach ($files as $file) {
            $contents = file_get_contents($file);
            if (basename($file) == 'README.md') {
                $indexAnalyzer = new IndexFileAnalyzer();
                $chapters = $indexAnalyzer->analyze($contents);
                break;
            }
            if (preg_match("/^(.*)\n=+/", $contents, $matches)) {
                $headlines[$file] = $matches[1];
            } else {
                $headlines[$file] = basename($file);
            }

        }
        return $chapters;
    }
protected function loadGuideStructure ( $ files ) { $ chapters = [ ] ; foreach ( $ files as $ file ) { $ contents = file_get_contents ( $ file ) ; if ( basename ( $ file ) == 'README.md' ) { $ indexAnalyzer = new IndexFileAnalyzer ( ) ; $ chapters = $ indexAnalyzer -> analyze ( $ contents ) ; break ; } if ( preg_match ( "/^(.*)\n=+/" , $ contents , $ matches ) ) { $ headlines [ $ file ] = $ matches [ 1 ] ; } else { $ headlines [ $ file ] = basename ( $ file ) ; } } return $ chapters ; }
Loads guide structure from a set of files
@param array $files
@return array
Loads guide structure from a set of files