import os def container(pagetitle="#_pagetitle_#",websitename="#_websitename_#",menu="\{menu\}",page="\{page\}"): "Return the global appearance of the website" return """ {pagetitle}
{PAGE}
""".format(MENU=menu,PAGE=page,websitename=websitename,pagetitle=pagetitle) def menu(previous="",menulist="\{menulist\}",articles="#_articles_#"): "Return the menu list" return """
  • {previous}
  • {articles} """.format(previous=previous,menulist=menulist,articles=articles) def content(content="\{content\}",title="\{title\}"): return """

    {title}

    {content}

    """.format(content=content,title=title) def mix_data(list_of_data): return "
    "+"".join(list_of_data)+"
    " # Inner functions icons={"image":"picture-o","audio":"music","text":"book","video":"film","folder":"folder","other":"file","previous":"arrow-left"} #"gear":"gear","edit":"edit" def geticon(datatype): "Get an Icon for the given datatype" try: return icons[datatype] except: return icons["other"] def menuitem(text,link,datatype): "Generate a menu link" #print (datatype) return """
  • {text}
  • """.format(text=text,link=link,datatype=geticon(datatype)) def makeSubNodelist(subnode,lang,getdatatype,makeHTMLName): items=[] for node in subnode.get_next_nodes(): if node.name[0]!="_": items.append(menuitem(node.get_title(lang),makeHTMLName(node),getdatatype(node.path))) for node in subnode.get_next_subtree(): #print(node,node.name) if node.name[0]!="_": items.append(menuitem(node.get_title(lang),node.path,"folder")) return items