Public Member Functions | Public Attributes | List of all members
mycroft.dialog.MustacheDialogRenderer Class Reference

Public Member Functions

def __init__ (self)
 
def load_template_file (self, template_name, filename)
 
def render (self, template_name, context=None, index=None)
 

Public Attributes

 templates
 

Detailed Description

A dialog template renderer based on the mustache templating language.

Definition at line 31 of file scripts/mycroft/dialog/__init__.py.

Constructor & Destructor Documentation

def mycroft.dialog.MustacheDialogRenderer.__init__ (   self)

Definition at line 36 of file scripts/mycroft/dialog/__init__.py.

Member Function Documentation

def mycroft.dialog.MustacheDialogRenderer.load_template_file (   self,
  template_name,
  filename 
)
Load a template by file name into the templates cache.

Args:
    template_name (str): a unique identifier for a group of templates
    filename (str): a fully qualified filename of a mustache template.

Definition at line 39 of file scripts/mycroft/dialog/__init__.py.

def mycroft.dialog.MustacheDialogRenderer.render (   self,
  template_name,
  context = None,
  index = None 
)
Given a template name, pick a template and render it using the context.
If no matching template exists use template_name as template.

Args:
    template_name (str): the name of a template group.
    context (dict): dictionary representing values to be rendered
    index (int): optional, the specific index in the collection of
templates

Returns:
    str: the rendered string

Definition at line 65 of file scripts/mycroft/dialog/__init__.py.

Member Data Documentation

mycroft.dialog.MustacheDialogRenderer.templates

Definition at line 37 of file scripts/mycroft/dialog/__init__.py.


The documentation for this class was generated from the following file:


mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:40