How to use the lookatme.widgets.clickable_text.ClickableText 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 / render / markdown_block.py View on Github external
:returns: A list of urwid Widgets or a single urwid Widget
    """
    headings = config.STYLE["headings"]
    level = token["level"]
    style = config.STYLE["headings"].get(str(level), headings["default"])

    prefix = styled_text(style["prefix"], style)
    suffix = styled_text(style["suffix"], style)

    rendered = render_text(text=token["text"])
    styled_rendered = styled_text(rendered, style, supplement_style=True)

    return [
        urwid.Divider(),
        ClickableText([prefix] + styled_text(rendered, style) + [suffix]),
        urwid.Divider(),
    ]
github d0c-s4vage / lookatme / lookatme / render / markdown_block.py View on Github external
Many other functions call this function directly, passing in the extra
    ``text`` argument and leaving all other arguments blank. 

    See :any:`lookatme.tui.SlideRenderer.do_render` for additional argument and
    return value descriptions.
    """
    if text is None:
        text = token["text"]

    inline_lexer = mistune.InlineLexer(markdown_inline_renderer)
    res = inline_lexer.output(text)
    if len(res) == 0:
        res = [""]

    return ClickableText(res)
github d0c-s4vage / lookatme / lookatme / widgets / table.py View on Github external
def header_modifier(cell):
            return ClickableText(styled_text(cell, "bold"), align=cell.align)