Skip to content

Templater

Bases: Protocol

Protocol that represents the parser. It is meant to be placed into a Renderer, and is responsible for parsing the document into a menu and a list of callables.

__init__(source)

This method is used to initialize the parser by parsing the source text.

Parameters:

  • source (str) –

    source text that is parsed

template(template_engine, keywords)

This method is used to template the embed by first retrieving it using its key, and then templating it using the template_engine

Parameters:

  • template_engine (TemplateEngine) –

    template engine that is used to template the embed

  • keywords (Dict[str, Any]) –

    keywords that are used to template the embed

Returns (str): templated embed in the form of string.