def page_from_raw_text(self, source_file, contents, extension_name):
        """
        Banana banana
        """
        raw_contents = contents

        meta = {}
        if contents.startswith('---\n'):
            split = contents.split('\n...\n', 1)
            if len(split) == 2:
                contents = split[1]
                try:
                    blocks = yaml.load_all(split[0], Loader=yaml.FullLoader)
                    for block in blocks:
                        if block:
                            meta.update(block)
                except ConstructorError as exception:
                    warn('invalid-page-metadata',
                         '%s: Invalid metadata: \n%s' % (source_file,
                                                         str(exception)))

        output_path = os.path.dirname(os.path.relpath(
            source_file, next(iter(self.project.include_paths))))

        ast = cmark.hotdoc_to_ast(contents, self)
        return Page(source_file, False, self.project.sanitized_name, extension_name,
                    source_file=source_file, ast=ast, meta=meta, raw_contents=raw_contents,
                    output_path=output_path)
def page_from_raw_text ( self , source_file , contents , extension_name ) : raw_contents = contents meta = { } if contents . startswith ( '---\n' ) : split = contents . split ( '\n...\n' , 1 ) if len ( split ) == 2 : contents = split [ 1 ] try : blocks = yaml . load_all ( split [ 0 ] , Loader = yaml . FullLoader ) for block in blocks : if block : meta . update ( block ) except ConstructorError as exception : warn ( 'invalid-page-metadata' , '%s: Invalid metadata: \n%s' % ( source_file , str ( exception ) ) ) output_path = os . path . dirname ( os . path . relpath ( source_file , next ( iter ( self . project . include_paths ) ) ) ) ast = cmark . hotdoc_to_ast ( contents , self ) return Page ( source_file , False , self . project . sanitized_name , extension_name , source_file = source_file , ast = ast , meta = meta , raw_contents = raw_contents , output_path = output_path )
Banana banana