MCPcopy Index your code
hub / github.com/nodejs/node / render

Method render

tools/inspector_protocol/jinja2/environment.py:993–1008  ·  view source on GitHub ↗

This method accepts the same arguments as the `dict` constructor: A dict, a dict subclass or some keyword arguments. If no arguments are given the context will be empty. These two calls do the same:: template.render(knights='that say nih') template.render({

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

991 return t
992
993 def render(self, *args, **kwargs):
994 """This method accepts the same arguments as the `dict` constructor:
995 A dict, a dict subclass or some keyword arguments. If no arguments
996 are given the context will be empty. These two calls do the same::
997
998 template.render(knights='that say nih')
999 template.render({'knights': 'that say nih'})
1000
1001 This will return the rendered template as unicode string.
1002 """
1003 vars = dict(*args, **kwargs)
1004 try:
1005 return concat(self.root_render_func(self.new_context(vars)))
1006 except Exception:
1007 exc_info = sys.exc_info()
1008 return self.environment.handle_exception(exc_info, True)
1009
1010 def render_async(self, *args, **kwargs):
1011 """This works similar to :meth:`render` but returns a coroutine

Callers

nothing calls this directly

Calls 4

new_contextMethod · 0.95
concatFunction · 0.85
exc_infoMethod · 0.80
handle_exceptionMethod · 0.45

Tested by

no test coverage detected