mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(llms): handle prose props in llms-full.txt (#4111)
This commit is contained in:
@@ -351,6 +351,7 @@ export default defineNitroPlugin((nitroApp) => {
|
|||||||
visitAndReplace(doc, 'component-props', (node) => {
|
visitAndReplace(doc, 'component-props', (node) => {
|
||||||
const attributes = node[1] as Record<string, string>
|
const attributes = node[1] as Record<string, string>
|
||||||
const mdcSpecificName = attributes?.name
|
const mdcSpecificName = attributes?.name
|
||||||
|
const isProse = parseBoolean(attributes[':prose'])
|
||||||
|
|
||||||
const finalComponentName = mdcSpecificName ? camelCase(mdcSpecificName) : componentName
|
const finalComponentName = mdcSpecificName ? camelCase(mdcSpecificName) : componentName
|
||||||
|
|
||||||
@@ -358,11 +359,13 @@ export default defineNitroPlugin((nitroApp) => {
|
|||||||
|
|
||||||
if (!componentMeta?.props) return
|
if (!componentMeta?.props) return
|
||||||
|
|
||||||
|
const interfaceName = isProse ? `Prose${pascalCaseName}Props` : `${pascalCaseName}Props`
|
||||||
|
|
||||||
const interfaceCode = generateTSInterface(
|
const interfaceCode = generateTSInterface(
|
||||||
`${pascalCaseName}Props`,
|
interfaceName,
|
||||||
Object.values(componentMeta.props),
|
Object.values(componentMeta.props),
|
||||||
propItemHandler,
|
propItemHandler,
|
||||||
`Props for the ${pascalCaseName} component`
|
`Props for the ${isProse ? 'Prose' : ''}${pascalCaseName} component`
|
||||||
)
|
)
|
||||||
replaceNodeWithPre(node, 'ts', interfaceCode)
|
replaceNodeWithPre(node, 'ts', interfaceCode)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user