class documentation

class TemplateBridge:

Known subclasses: sphinx.jinja2glue.BuiltinTemplateLoader

View In Hierarchy

This class defines the interface for a "template bridge", that is, a class that renders templates given a template name and a context.
Method init Called by the builder to initialize the template system.
Method newest​_template​_mtime Called by the builder to determine if output files are outdated because of template changes. Return the mtime of the newest template file that was changed. The default implementation returns 0.
Method render Called by the builder to render a template given as a filename with a specified context (a Python dictionary).
Method render​_string Called by the builder to render a template given as a string with a specified context (a Python dictionary).
def init(self, builder, theme=None, dirs=None):

Called by the builder to initialize the template system.

builder is the builder object; you'll probably want to look at the value of builder.config.templates_path.

theme is a sphinx.theming.Theme object or None; in the latter case, dirs can be list of fixed directories to look for templates.

Parameters
builder:BuilderUndocumented
theme:ThemeUndocumented
dirs:List[str]Undocumented
def newest_template_mtime(self):
Called by the builder to determine if output files are outdated because of template changes. Return the mtime of the newest template file that was changed. The default implementation returns 0.
Returns
floatUndocumented
def render(self, template, context):
Called by the builder to render a template given as a filename with a specified context (a Python dictionary).
Parameters
template:strUndocumented
context:DictUndocumented
def render_string(self, template, context):
Called by the builder to render a template given as a string with a specified context (a Python dictionary).
Parameters
template:strUndocumented
context:DictUndocumented
Returns
strUndocumented