From 734189ba3502562e3a8221ed5da74dde30102d50 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 28 Apr 2023 10:54:31 -0500 Subject: [PATCH] chore: organize markdoc lib --- src/app/lib/markdoc.ts | 58 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/app/lib/markdoc.ts b/src/app/lib/markdoc.ts index fb68c5b..5aedf1e 100644 --- a/src/app/lib/markdoc.ts +++ b/src/app/lib/markdoc.ts @@ -8,35 +8,6 @@ import Fence from '../components/Fence'; import { DOCS_PATH } from '../constants'; import { Doc, DocSection } from './../types/types'; -export function getCopyPath( - version: string, - doc: Doc, - docPath: string -): string { - if (doc.copy === undefined) { - return ''; - } - - return path.join(DOCS_PATH, version, docPath, doc.copy); -} - -export function getExamplePath( - version: string, - doc: Doc, - docPath: string -): string { - if (doc.example === undefined) { - return ''; - } - - return path.join( - DOCS_PATH, - version, - docPath, - doc.example - ); -} - const markDocConfig = { nodes: { fence: { @@ -95,6 +66,35 @@ function parseMarkdown(sourcePath: string): ReactNode { return children; } +export function getCopyPath( + version: string, + doc: Doc, + docPath: string +): string { + if (doc.copy === undefined) { + return ''; + } + + return path.join(DOCS_PATH, version, docPath, doc.copy); +} + +export function getExamplePath( + version: string, + doc: Doc, + docPath: string +): string { + if (doc.example === undefined) { + return ''; + } + + return path.join( + DOCS_PATH, + version, + docPath, + doc.example + ); +} + function getCopyChild( version: string, doc: Doc,