def parse_config(self, config, toplevel=False):
self.sitemap_path = config.get_path('<STR_LIT>')<EOL>if self.sitemap_path is None:<EOL><INDENT>error('<STR_LIT>',<EOL>'<STR_LIT>')<EOL><DEDENT>self.include_paths = OrderedSet([])<EOL>index_file = config.get_index()<EOL>if index_file:<EOL><INDENT>if not os.path.exists(index_file):<EOL><INDENT>error('<STR_LIT>',<EOL>'<STR_LIT>' %<EOL>index_file)<EOL><DEDENT>self.include_paths |= OrderedSet([os.path.dirname(index_file)])<EOL><DEDENT>self.include_paths |= OrderedSet(config.get_paths('<STR_LIT>'))<EOL>self.is_toplevel = toplevel<EOL>self.tree = Tree(self, self.app)<EOL>self.__create_extensions()<EOL>for extension in list(self.extensions.values()):<EOL><INDENT>if toplevel:<EOL><INDENT>extension.parse_toplevel_config(config)<EOL><DEDENT>extension.parse_config(config)<EOL><DEDENT>self.extra_asset_folders = OrderedSet(config.get_paths('<STR_LIT>'))<EOL>
Parses @config setting up @self state.