docs: migrate UI docs (#13245)
* docs: create a new UI docs project (#13233) * docs: create a new UI docs project * fix installation errors * docs: migrate UI docs content to new project (#13241) * Fix content * added examples for some components * finish adding examples * lint fix * fix build errors * delete empty files * path fixes + refactor * fix build error
This commit is contained in:
@@ -65,7 +65,6 @@ function checkLocalLinkExists({
|
||||
fileToCheck = fileToCheck.replace(/^\//, "")
|
||||
// get absolute path of the URL
|
||||
const linkedFilePath = path.resolve(basePath, fileToCheck).replace(/#.*$/, "")
|
||||
// console.log(link, currentPageFilePath, basePath, fileToCheck, linkedFilePath)
|
||||
// check if the file exists
|
||||
if (existsSync(linkedFilePath)) {
|
||||
return
|
||||
@@ -130,13 +129,10 @@ function mdxPageExists(pagePath: string): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
if (existsSync(path.join(pagePath, "page.mdx"))) {
|
||||
return true
|
||||
}
|
||||
|
||||
// for projects that use a convention other than mdx
|
||||
// check if an mdx file exists with the same name
|
||||
return readdirSync(pagePath).some((fileName) => fileName.endsWith(".mdx"))
|
||||
return (
|
||||
existsSync(path.join(pagePath, "page.mdx")) ||
|
||||
existsSync(path.join(pagePath, "page.tsx"))
|
||||
)
|
||||
}
|
||||
|
||||
function componentChecker({
|
||||
|
||||
@@ -38,7 +38,7 @@ export function uiRehypePlugin({ exampleRegistry }: Options) {
|
||||
tagName: "span",
|
||||
properties: {
|
||||
__src__: src,
|
||||
code: source,
|
||||
codeLinesJSON: JSON.stringify(source.split("\n")),
|
||||
},
|
||||
})
|
||||
)
|
||||
@@ -53,7 +53,7 @@ export function uiRehypePlugin({ exampleRegistry }: Options) {
|
||||
return null
|
||||
}
|
||||
|
||||
const mainSpecsDir = path.join(process.cwd(), "src/specs")
|
||||
const mainSpecsDir = path.join(process.cwd(), "specs", "components")
|
||||
const componentSpecsDir = path.join(mainSpecsDir, mainComponent)
|
||||
const specs: Documentation[] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user