Skip to content

JSON

Bases: Templater

This method is used to parse the document into a menu and a list of callables for .json files

__init__(source)

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

Parameters:

  • source (str) –

    source text that is parsed

recursive_template(obj, template_engine, keywords)

Method that is used to recursively template the object using the templater and the keywords.

Parameters:

  • obj (Dict | List | str | Any) –

    object that is templated

  • template_engine (TemplateEngine) –

    template engine that is used to template the object

  • keywords (Dict[str, Any]) –

    keywords that are used to template the object

Returns (Dict[str, Any]): templated object

template(template_engine, keywords)

This method is used to template the element 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 element

  • keywords (Dict[str, Any]) –

    keywords that are used to template the element

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