lookatme.render.markdown_block module¶
Defines render functions that render lexed markdown block tokens into urwid representations
-
lookatme.render.markdown_block.
render_block_quote_end
(token, body, stack, loop)[source]¶ Pops the block quote start
urwid.Pile()
from the stack, taking future renderings out of the block quote styling.See
lookatme.tui.SlideRenderer.do_render
for additional argument and return value descriptions.
-
lookatme.render.markdown_block.
render_block_quote_start
(token, body, stack, loop)[source]¶ Begins rendering of a block quote. Pushes a new
urwid.Pile()
to the stack that is indented, has styling applied, and has the quote markers on the left.This function makes use of the styles:
quote: top_corner: "┌" bottom_corner: "└" side: "╎" style: bg: default fg: italics,#aaa
See
lookatme.tui.SlideRenderer.do_render
for additional argument and return value descriptions.
-
lookatme.render.markdown_block.
render_code
(token, body, stack, loop)[source]¶ Renders a code block using the Pygments library.
See
lookatme.tui.SlideRenderer.do_render
for additional argument and return value descriptions.
-
lookatme.render.markdown_block.
render_heading
(token, body, stack, loop)[source]¶ Render markdown headings, using the defined styles for the styling and prefix/suffix.
See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.Below are the default stylings for headings:
headings: '1': bg: default fg: '#9fc,bold' prefix: "██ " suffix: "" '2': bg: default fg: '#1cc,bold' prefix: "▓▓▓ " suffix: "" '3': bg: default fg: '#29c,bold' prefix: "▒▒▒▒ " suffix: "" '4': bg: default fg: '#66a,bold' prefix: "░░░░░ " suffix: "" default: bg: default fg: '#579,bold' prefix: "░░░░░ " suffix: ""
Returns: A list of urwid Widgets or a single urwid Widget
-
lookatme.render.markdown_block.
render_hrule
(token, body, stack, loop)[source]¶ Render a newline
See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_list_end
(token, body, stack, loop)[source]¶ Pops the pushed
urwid.Pile()
from the stack (decreases indentation)See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_list_item_end
(token, body, stack, loop)[source]¶ Pops the pushed
urwid.Pile()
from the stack (decreases indentation)See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_list_item_start
(token, body, stack, loop)[source]¶ Render the start of a list item. This function makes use of the styles:
bullets: '1': "•" '2': "⁃" '3': "◦" default: "•"
See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_list_start
(token, body, stack, loop)[source]¶ Handles the indentation when starting rendering a new list. List items themselves (with the bullets) are rendered by the
render_list_item_start
function.See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_loose_item_start
(token, body, stack, loop)[source]¶ Render the start of a list item. This function makes use of the styles:
bullets: '1': "•" '2': "⁃" '3': "◦" default: "•"
See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_newline
(token, body, stack, loop)[source]¶ Render a newline
See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.
-
lookatme.render.markdown_block.
render_paragraph
(token, body, stack, loop)[source]¶ Renders the provided text with additional pre and post paddings.
See
lookatme.tui.SlideRenderer.do_render
for additional argument and return value descriptions.
-
lookatme.render.markdown_block.
render_table
(token, body, stack, loop)[source]¶ Renders a table using the
Table
widget.See
lookatme.tui.SlideRenderer.do_render
for argument and return value descriptions.The table widget makes use of the styles below:
table: column_spacing: 3 header_divider: "─"
Returns: A list of urwid Widgets or a single urwid Widget
-
lookatme.render.markdown_block.
render_text
(token=None, body=None, stack=None, loop=None, text=None)[source]¶ Renders raw text. This function uses the inline markdown lexer from mistune with the
lookatme.render.markdown_inline
render module to render the lexed inline markup to a list composed of widgets or urwid Text markup. The created list of widgets/Text markup is then used to create and return a list composed entirely of widgets andClickableText
instances.Many other functions call this function directly, passing in the extra
text
argument and leaving all other arguments blank.See
lookatme.tui.SlideRenderer.do_render
for additional argument and return value descriptions.