Skip to content

Commit

Permalink
docs: add docstring to render_template method
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Aug 18, 2023
1 parent 644ec41 commit a726f71
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions h5pxblock/h5pxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ def resource_string(self, path):
return data.decode("utf8")

def render_template(self, template_path, context):
"""
Render a template with the given context. The template is translated
according to the user's language.
Args:
template_path (str): The path to the template
context(dict, optional): The context to render in the template
Returns:
str: The rendered template
"""
return loader.render_django_template(
template_path,
context,
Expand Down

0 comments on commit a726f71

Please sign in to comment.