import cgitb import markdown2 cgitb.enable() class HTMLgen: def __init__(self, layout, title): self.layout=layout self.articles=[] self.titles=[] self.title=title def addArticle(self, name, markdown): self.articles.append(markdown2.markdown(markdown)) self.titles.append(name) def renderSite(self): nav="" x=0 for title in self.titles: nav=nav+("%s" % (x, title)) x=x+1 main="" x=0 for article in self.articles: main=main+("