chore: organize markdoc lib

This commit is contained in:
Stevan Freeborn
2023-04-28 10:54:31 -05:00
parent 9d0c148db1
commit 734189ba35
+29 -29
View File
@@ -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,