chore: organize markdoc lib
This commit is contained in:
+29
-29
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user