How to use the lookatme.slide.Slide function in lookatme

To help you get started, we’ve selected a few lookatme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d0c-s4vage / lookatme / lookatme / parser.py View on Github external
:param str input_data: The input data string
        :returns: tuple of (remaining_data, slide)
        """
        # slides are delimited by ---
        md = mistune.Markdown()

        state = {}
        tokens = md.block.parse(input_data, state)

        slides = []
        curr_slide_tokens = []
        for token in tokens:
            # new slide!
            if token["type"] == "hrule":
                slide = Slide(curr_slide_tokens, md, len(slides))
                slides.append(slide)
                curr_slide_tokens = []
                continue
            else:
                curr_slide_tokens.append(token)

        slides.append(Slide(curr_slide_tokens, md, len(slides)))

        return "", slides
github d0c-s4vage / lookatme / lookatme / parser.py View on Github external
state = {}
        tokens = md.block.parse(input_data, state)

        slides = []
        curr_slide_tokens = []
        for token in tokens:
            # new slide!
            if token["type"] == "hrule":
                slide = Slide(curr_slide_tokens, md, len(slides))
                slides.append(slide)
                curr_slide_tokens = []
                continue
            else:
                curr_slide_tokens.append(token)

        slides.append(Slide(curr_slide_tokens, md, len(slides)))

        return "", slides