def get_template_vars(self, slides):
        """ Computes template vars from slides html source code.
        """
        try:
            head_title = slides[0]['title']
        except (IndexError, TypeError):
            head_title = "Untitled Presentation"

        for slide_index, slide_vars in enumerate(slides):
            if not slide_vars:
                continue
            self.num_slides += 1
            slide_number = slide_vars['number'] = self.num_slides
            if slide_vars['level'] and slide_vars['level'] <= TOC_MAX_LEVEL:
                self.add_toc_entry(slide_vars['title'], slide_vars['level'],
                                   slide_number)
            else:
                # Put something in the TOC even if it doesn't have a title or level
                self.add_toc_entry(u"-", 1, slide_number)

        return {'head_title': head_title, 'num_slides': str(self.num_slides),
                'slides': slides, 'toc': self.toc, 'embed': self.embed,
                'css': self.get_css(), 'js': self.get_js(),
                'user_css': self.user_css, 'user_js': self.user_js,
                'math_output': self.math_output}
def get_template_vars ( self , slides ) : try : head_title = slides [ 0 ] [ 'title' ] except ( IndexError , TypeError ) : head_title = "Untitled Presentation" for slide_index , slide_vars in enumerate ( slides ) : if not slide_vars : continue self . num_slides += 1 slide_number = slide_vars [ 'number' ] = self . num_slides if slide_vars [ 'level' ] and slide_vars [ 'level' ] <= TOC_MAX_LEVEL : self . add_toc_entry ( slide_vars [ 'title' ] , slide_vars [ 'level' ] , slide_number ) else : self . add_toc_entry ( u"-" , 1 , slide_number ) return { 'head_title' : head_title , 'num_slides' : str ( self . num_slides ) , 'slides' : slides , 'toc' : self . toc , 'embed' : self . embed , 'css' : self . get_css ( ) , 'js' : self . get_js ( ) , 'user_css' : self . user_css , 'user_js' : self . user_js , 'math_output' : self . math_output }
Computes template vars from slides html source code.