diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-06-27 23:39:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-06-27 23:39:31 +0900 |
| commit | 674fe965550444db87edc7937ff6932e1a918d9d (patch) | |
| tree | e8a80dd958d3e082485286bf5785a7992b6e6b0e /services/blog/nuldoc-src/render.ts | |
| parent | fe4d1d625b53796c5f20399790e5ff8c7a7e1608 (diff) | |
| download | nsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.tar.gz nsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.tar.zst nsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.zip | |
feat(meta): rename vhosts/ directory to services/
Diffstat (limited to 'services/blog/nuldoc-src/render.ts')
| -rw-r--r-- | services/blog/nuldoc-src/render.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/blog/nuldoc-src/render.ts b/services/blog/nuldoc-src/render.ts new file mode 100644 index 00000000..fbad25ab --- /dev/null +++ b/services/blog/nuldoc-src/render.ts @@ -0,0 +1,13 @@ +import { Node } from "./dom.ts"; +import { renderHtml } from "./renderers/html.ts"; +import { renderXml } from "./renderers/xml.ts"; + +export type RendererType = "html" | "xml"; + +export function render(root: Node, renderer: RendererType): string { + if (renderer === "html") { + return renderHtml(root); + } else { + return renderXml(root); + } +} |
