From 2428ea512cdbac4b86189c654814c5eeca54a704 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Mar 2023 15:54:53 +0900 Subject: refactor: add Page type to represent single web page --- nuldoc-src/render.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 nuldoc-src/render.ts (limited to 'nuldoc-src/render.ts') diff --git a/nuldoc-src/render.ts b/nuldoc-src/render.ts new file mode 100644 index 0000000..feb72a4 --- /dev/null +++ b/nuldoc-src/render.ts @@ -0,0 +1,13 @@ +import { Node } from "./dom.ts"; +import { renderHtml } from "./renderers/html.ts"; + +// export type RendererType = "html" | "xml"; +export type RendererType = "html"; + +export function render(root: Node, renderer: RendererType): string { + if (renderer === "html") { + return renderHtml(root); + } else { + return renderHtml(root); + } +} -- cgit v1.2.3-70-g09d2