summaryrefslogtreecommitdiffstats
path: root/lps_gen.py
diff options
context:
space:
mode:
authorjantwisted <janith@member.fsf.org>2015-12-16 01:51:13 +0530
committerjantwisted <janith@member.fsf.org>2015-12-16 01:51:13 +0530
commit9a9052e5bd06dd3ecafe263f9f5546435f12e616 (patch)
tree5475f31820eada1be08219003411e571892a8c19 /lps_gen.py
parent01997af8b0c04318c2c76afc29eb043052e3d793 (diff)
comment added
Diffstat (limited to 'lps_gen.py')
-rw-r--r--lps_gen.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/lps_gen.py b/lps_gen.py
index a7690b2..9476e75 100644
--- a/lps_gen.py
+++ b/lps_gen.py
@@ -133,15 +133,18 @@ class LPSMarkdown(Markdown):
html = super(LPSMarkdown, self).parse(text)
return lps_dict
-def HTMLRender(_dict):
-
- templateLoader = jinja2.FileSystemLoader( searchpath="./" )
- templateEnv = jinja2.Environment( loader=templateLoader )
- TEMPLATE_FILE = "tests/files/index.html"
- template = templateEnv.get_template( TEMPLATE_FILE )
- _data = {'res':_dict}
- outputText = template.render( _data )
- return outputText
+def HTMLRender(_dict):
+ """Render html from a dictionary and returns a string.
+
+ Uses jinja2 and HTML template file.
+ """
+ templateLoader = jinja2.FileSystemLoader( searchpath="./" )
+ templateEnv = jinja2.Environment( loader=templateLoader )
+ TEMPLATE_FILE = "tests/files/index.html"
+ template = templateEnv.get_template( TEMPLATE_FILE )
+ _data = {'res':_dict}
+ lps_output = template.render( _data )
+ return lps_output
def main():
parser = ArgumentParser()