lookatme.render.markdown_inline module

Defines render functions that work with mistune’s markdown inline lexer render interface

Renders a URI as a link

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.codespan(text, old_styles)[source]

Renders inline code using the pygments renderer. This function also makes use of the coding style:

style: monokai
Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.double_emphasis(text, old_styles)[source]

Renders double emphasis. Handles both **word** and __word__

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.emphasis(text, old_styles)[source]

Renders double emphasis. Handles both *word* and _word_

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.escape(text)[source]

Renders escapes

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.expanded_styles(fn)[source]
lookatme.render.markdown_inline.footnote_ref(key, index)[source]

Renders a footnote

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.image(link_uri, title, text)[source]

Renders an image as a link. This would be a cool extension to render referenced images as scaled-down ansii pixel blocks.

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.inline_html(text)[source]

Renders inline html as plaintext

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.linebreak()[source]

Renders a line break

Returns

list of urwid Text markup tuples.

Renders a link. This function does a few special things to make the clickable links happen. All text in lookatme is rendered using the ClickableText class. The ClickableText class looks for urwid.AttrSpec instances that are actually LinkIndicatorSpec instances within the Text markup. If an AttrSpec is an instance of LinkIndicator spec in the Text markup, ClickableText knows to handle clicks on that section of the text as a link.

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.placeholder()[source]

The starting point of the rendering. The final result will be this returned list with all inline markdown tokens translated into urwid objects

lookatme.render.markdown_inline.render_no_change(text)[source]

Render inline markdown text with no changes

lookatme.render.markdown_inline.strikethrough(text, old_styles)[source]

Renders strikethrough text (~~text~~)

Returns

list of urwid Text markup tuples.

lookatme.render.markdown_inline.text(text)[source]

Renders plain text (does nothing)

Returns

list of urwid Text markup tuples.