def serialize(env): env.output["format"]="text/html" html=tree2xml(env.generations["layout"]) del env.generations["layout"] #del env.output["html"] html=html.replace("</head>","<script>var appData="+json_compat.dumps(env.generations,default=default)+"</script></head>") return """<!DOCTYPE html>\n%s\n"""%(html)
def serialize(env): env.output["format"]="text/html" try: html=tree2xml(env.generations["layout"]) del env.generations["layout"] except: html="<html><head></head><body></body></html>" #del env.output["html"] try: html=html.replace("</head>","<script>var appData="+json_compat.dumps(env.generations,default=default)+"</script></head>") except: pass return """<!DOCTYPE html>\n%s\n"""%(html)
def serialize(acenv): if not json_compat: return "ERROR: JSON serializer not installed" #try: return json_compat.dumps(acenv.generations,default=default)