make html generated cleaner in view source

This commit is contained in:
Sanj 2011-12-22 19:07:14 +05:30
parent f9590eaf07
commit 6eec8b4228

View File

@ -8,10 +8,10 @@ def JSONtoHTML():
html = ''
counter = 1
for d in data:
html += '<div class="container" data-name="%s" data-padma="%s">' % (d['name'], d['hid'],)
html += '<div class="title"><span class="counter">%d&gt;</span> %s</div>' % (counter, d['title'],)
html += '<div class="time">%s</div>' % (d['dt-time'],)
html += "</div>"
html += '<div class="container" data-name="%s" data-padma="%s">\n' % (d['name'], d['hid'],)
html += ' <div class="title"><span class="counter">%d&gt;</span> %s</div>\n' % (counter, d['title'],)
html += ' <div class="time">%s</div>\n' % (d['dt-time'],)
html += "</div>\n\n"
counter += 1
indexFile = codecs.open("index.html", mode="w", encoding="utf-8")
header = open("header.html").read()