aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/render.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-18 15:54:53 +0900
committernsfisis <nsfisis@gmail.com>2023-03-18 16:17:21 +0900
commit2428ea512cdbac4b86189c654814c5eeca54a704 (patch)
tree70fb4eab0d0b87155112f4370853dbde387fd021 /nuldoc-src/render.ts
parent2b50e1778b164e641c03c2e77176b6f47ca1e278 (diff)
downloadblog.nsfisis.dev-2428ea512cdbac4b86189c654814c5eeca54a704.tar.gz
blog.nsfisis.dev-2428ea512cdbac4b86189c654814c5eeca54a704.tar.zst
blog.nsfisis.dev-2428ea512cdbac4b86189c654814c5eeca54a704.zip
refactor: add Page type to represent single web page
Diffstat (limited to 'nuldoc-src/render.ts')
-rw-r--r--nuldoc-src/render.ts13
1 files changed, 13 insertions, 0 deletions
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);
+ }
+}