diff --git a/app/test/page.tsx b/app/test/page.tsx index 32714bf..fb7d2a8 100644 --- a/app/test/page.tsx +++ b/app/test/page.tsx @@ -3,18 +3,33 @@ import React from "react"; // metadata, // } from "@/content/01-introduction/01-why-json-schema.mdx"; import ContentManager from "@/lib/contentManager"; -import { CustomMDX } from "../components/mdx"; -import { MDXRemote } from "next-mdx-remote/rsc"; - +import { + List, + ListItem, + ListIcon, + OrderedList, + UnorderedList, +} from "@chakra-ui/react"; export default function Test() { const cm = new ContentManager(); - const { metadata, Page } = cm.parseMdxFile( - "01-introduction/01-why-json-schema.mdx" - ); - + const outline = cm.outline; + console.log(outline); return (
- + + {outline.map((item) => { + return ( + + {item.title} + + {item.steps.map((step) => ( + {step.title} + ))} + + + ); + })} +
); } diff --git a/content/01-introduction/01-why-json-schema.mdx b/content/01-introduction/01-why-json-schema.mdx index 24d3aa8..011c219 100644 --- a/content/01-introduction/01-why-json-schema.mdx +++ b/content/01-introduction/01-why-json-schema.mdx @@ -1,6 +1,6 @@ --- -title : "Demo" -author: "Author Name" +title : "why json schema" + --- diff --git a/content/01-introduction/02-modify-a-array.mdx b/content/01-introduction/02-modify-a-array.mdx deleted file mode 100644 index 8b13789..0000000 --- a/content/01-introduction/02-modify-a-array.mdx +++ /dev/null @@ -1 +0,0 @@ - diff --git a/content/01-introduction/02-modify-an-array.mdx b/content/01-introduction/02-modify-an-array.mdx new file mode 100644 index 0000000..84dbd73 --- /dev/null +++ b/content/01-introduction/02-modify-an-array.mdx @@ -0,0 +1,4 @@ +--- +title : "Modify an array" + +--- \ No newline at end of file diff --git a/content/02-types/01-why-json-schema.mdx b/content/02-types/01-why-json-schema.mdx index 8b13789..d399ac4 100644 --- a/content/02-types/01-why-json-schema.mdx +++ b/content/02-types/01-why-json-schema.mdx @@ -1 +1,4 @@ +--- +title: "Strings" +--- diff --git a/content/02-types/02-modify-a-array.mdx b/content/02-types/02-modify-a-array.mdx index 8b13789..c9a9d76 100644 --- a/content/02-types/02-modify-a-array.mdx +++ b/content/02-types/02-modify-a-array.mdx @@ -1 +1,4 @@ +--- +title: "Objects" +--- diff --git a/lib/contentManager.ts b/lib/contentManager.ts index 0e720e3..00a440e 100644 --- a/lib/contentManager.ts +++ b/lib/contentManager.ts @@ -92,7 +92,7 @@ export default class ContentManager { contentOutline.push(chapter); } }); - console.log(contentOutline[0].steps); + return contentOutline; } }