{JSON.stringify(page.astRoot, null, 2)}+
{node.value.replace(/\r?\n|\r/g, " ")}
;
+ ////////////////////////// Block Content
+ case "thematicBreak":
+ return {context.compileChildren(node)}
; + case "blockquote": + return{context.compileChildren(node)}; + case "code": + return ( +
+
+ {node.value}
+
+
+ );
+ case "list":
+ return compileList(context, node);
+ case "listItem":
+ return compileListItem(context, node, parent);
+ //case "table":
+ // break;
+ // Text- and Block-Level JSX or HTML Element
+ case "mdxJsxFlowElement":
+ case "mdxJsxTextElement":
+ return compileCustomElement(context, node);
+
+ default:
+ return compileError(node, "Unhandled node type");
+ }
+}
+
+export function compilePage(
+ guide: Guide,
+ pageId: string,
+ page: ExportedPage
+): ReactNode {
+ const astRoot = page.astRoot;
+ assertNodeType(astRoot, "root");
+
+ const context: CompileContext = {
+ guide,
+ pageId,
+ compileChildren: (parent: Parent) => {
+ return compileChildren(context, parent.children, parent, compileContent);
+ },
+ compileContentNode: (node, parent) => compileContent(context, node, parent),
+ };
+
+ return context.compileChildren(astRoot);
+}
diff --git a/src/pageCompiler/customElement.ts b/src/pageCompiler/customElement.ts
new file mode 100644
index 0000000..4df8aa1
--- /dev/null
+++ b/src/pageCompiler/customElement.ts
@@ -0,0 +1,79 @@
+import { CompileContext } from "./compilePage.tsx";
+
+import type { MdxJsxFlowElement, MdxJsxTextElement } from "mdast-util-mdx-jsx";
+import React, { ComponentClass, FunctionComponent, ReactNode } from "react";
+import BlockImage from "../components/BlockImage.tsx";
+import ItemLink from "../components/ItemLink.tsx";
+import ItemImage from "../components/ItemImage.tsx";
+import ItemIcon from "../components/ItemIcon.tsx";
+import ItemGrid from "../components/ItemGrid.tsx";
+import Recipe from "../components/recipes/Recipe.tsx";
+import RecipeFor from "../components/recipes/RecipeFor.tsx";
+import Row from "../components/Row.tsx";
+import Column from "../components/Column.tsx";
+import GameScene from "../components/GameScene.tsx";
+import compileError from "./compileError.tsx";
+
+const components: Record<
+ string,
+ FunctionComponent