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;
    }