sO snippetTranspileWebBot(S uri, SS params, int refreshDelay) { if (eq("1", params.get('medium))) { veryQuickJava_mediumRefresh(); print("Medium-refreshed transpiler."); } if (eq("1", params.get('fresh))) { refreshTranspiler(); print("Refreshed transpiler."); } // use new TranspileForServer class (now default) //bool useNewTFS = eq("1", params.get("newTFS")); bool useNewTFS = !eq("0", params.get("newTFS")); uri = dropPrefixSlash(uri); if (isSnippetID(uri)) params.put(snippetID := uri); if (empty(params.get('snippetID))) ret "OK"; sendToSnippetUpdatesBot("/transpiling/" + psI(params.get('snippetID))); final bool compile = eq("1", params.get('compile)); final new Flag ok; print_byThread = new InheritableThreadLocal; S text = hijackPrint_tee(r { S snippetID = fsI(params.get('snippetID)); pcall { bool isInclude = getSnippetType(snippetID) == snippetType_JavaXInclude(); transpileRaw_translator(); set(transpileRaw_trans, +print_byThread); print("Set print_byThread (" + print_byThread! + ") in " + systemHashCode(transpileRaw_trans)); temp tempSetTL(transpileRaw_asInclude, isInclude); if (useNewTFS) new TranspileForServer(snippetID).run(); else { temp tempSetTL(transpileForServer_compile, compile); transpileForServer(snippetID); } ok.raise(); } }); S redirect = params.get('redirect); ret hhtml(hhead(htitle((ok.isUp() ? "OK" : "Failed") + " Transpilation") + (ok.isUp() && nempty(redirect) ? hrefresh(refreshDelay, redirect) : "")) + hbody(hsourcecode(text))) + (ok.isUp() ? "" : hjs_scrollDownOnPageLoad()); }