MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / renderHTML

Method renderHTML

framework/framework/server.ts:208–219  ·  view source on GitHub ↗
(templateName: string, args: Record<string, any>)

Source from the content-addressed store, hash-verified

206 }
207
208 renderHTML(templateName: string, args: Record<string, any>) {
209 const renderers = Object.values((this.ctx as any).server.renderers as Record<string, Renderer>)
210 .filter((r) => r.accept.includes(templateName) || r.asFallback);
211 const topPrio = renderers.sort((a, b) => b.priority - a.priority)[0];
212 const engine = topPrio?.render || (() => JSON.stringify(args, serializer(false, this)));
213 return engine(templateName, args, {
214 handler: this,
215 UserContext: this.user,
216 url: this.url,
217 _: this.translate,
218 });
219 }
220}
221
222export class Handler extends HandlerCommon {

Callers 13

renderUserMethod · 0.80
renderProblemMethod · 0.80
renderContestMethod · 0.80
renderHomeworkMethod · 0.80
getMethod · 0.80
getMethod · 0.80
postMethod · 0.80
postMethod · 0.80
postChangeMailMethod · 0.80
displayFunction · 0.80
onRecordChangeMethod · 0.80
sendUpdateMethod · 0.80

Calls 1

serializerFunction · 0.85

Tested by

no test coverage detected