From 4c6257012d3a67e8df2a69f9962d229056af269e Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 9 Apr 2023 14:50:50 -0500 Subject: [PATCH] feat: add custom code tag to markdown --- src/app/components/Code.module.css | 0 src/app/components/Code.tsx | 15 ++++ src/app/components/Section.module.css | 5 ++ src/app/components/Section.tsx | 16 ++-- src/app/components/SideBar.tsx | 12 +-- src/app/lib/markdoc.ts | 93 ++++++++++++++++++++ src/app/page.tsx | 83 +++-------------- src/app/types/types.ts | 14 ++- src/docs/version_001/docsStructure.ts | 21 +++-- src/docs/version_002/docsStructure.ts | 35 ++++---- src/docs/version_002/introduction/copy.md | 6 +- src/docs/version_002/introduction/example.md | 4 + 12 files changed, 189 insertions(+), 115 deletions(-) create mode 100644 src/app/components/Code.module.css create mode 100644 src/app/components/Code.tsx create mode 100644 src/app/lib/markdoc.ts diff --git a/src/app/components/Code.module.css b/src/app/components/Code.module.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/Code.tsx b/src/app/components/Code.tsx new file mode 100644 index 0000000..7db4c3b --- /dev/null +++ b/src/app/components/Code.tsx @@ -0,0 +1,15 @@ +import styles from './Code.module.css'; + +export default function Code({ + children, + language, +}: { + children: string; + language: string; +}) { + return ( +
+      {children}
+    
+ ); +} diff --git a/src/app/components/Section.module.css b/src/app/components/Section.module.css index 323f54f..16612ea 100644 --- a/src/app/components/Section.module.css +++ b/src/app/components/Section.module.css @@ -17,4 +17,9 @@ .container>article { flex: 1; +} + +.container>article>p { + margin-top: 20px; + color: #c1c9d2 } \ No newline at end of file diff --git a/src/app/components/Section.tsx b/src/app/components/Section.tsx index f559fd0..5989472 100644 --- a/src/app/components/Section.tsx +++ b/src/app/components/Section.tsx @@ -1,18 +1,14 @@ +import { ReactNode } from 'react'; import styles from './Section.module.css'; export default function Section({ - copy, - example, + children, }: { - copy: string; - example: string; + children: ReactNode; }) { return ( -
+
+ {children} +
); } diff --git a/src/app/components/SideBar.tsx b/src/app/components/SideBar.tsx index f27ba98..f18aa83 100644 --- a/src/app/components/SideBar.tsx +++ b/src/app/components/SideBar.tsx @@ -1,10 +1,10 @@ 'use client'; import { useState } from 'react'; -import { DocsStructure } from '../types/types.js'; +import { Doc, DocsStructure } from '../types/types.js'; import styles from './SideBar.module.css'; -function TreeNode({ doc }: { doc: DocsStructure }) { +function TreeNode({ doc }: { doc: Doc }) { const [isExpanded, setIsExpanded] = useState(true); @@ -62,7 +62,7 @@ function TreeNode({ doc }: { doc: DocsStructure }) { ); } -function ListTree({ docs }: { docs: DocsStructure[] }) { +function ListTree({ docs }: { docs: Doc[] }) { return (