Skip to content

Commit 988294c

Browse files
committed
build: update API generator
1 parent dbd9f92 commit 988294c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/docs/build/api.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@ const DOCGEN_OPTIONS = {
5252
* List of pro components that require special handling.
5353
*/
5454
const PRO_COMPONENTS = [
55+
'CCalendar',
5556
'CDatePicker',
5657
'CDateRangePicker',
5758
'CFormMask',
5859
'CLoadingButton',
5960
'CMultiSelect',
6061
'CRating',
62+
'CRangeSlider',
63+
'CRating',
6164
'CSmartPagination',
6265
'CSmartTable',
6366
'CTimePicker',
@@ -72,13 +75,10 @@ const PRO_COMPONENTS = [
7275
*/
7376
function escapeMarkdown(text) {
7477
if (typeof text !== 'string') return text
75-
return (
76-
text
77-
.replaceAll(/(<)/g, String.raw`\$1`)
78-
// .replaceAll(/<C(.*)\/>/g, '`<C$1/>`')
79-
.replaceAll('\n', '<br/>')
80-
.replaceAll(/`([^`]+)`/g, '<code>{`$1`}</code>')
81-
)
78+
return text
79+
.replaceAll(/(<)/g, String.raw`\$1`)
80+
.replaceAll('\n', '<br/>')
81+
.replaceAll(/`([^`]+)`/g, '<code>{`$1`}</code>')
8282
}
8383

8484
/**
@@ -190,10 +190,10 @@ async function createMdx(file, component) {
190190
let content = `\n\`\`\`jsx\n`
191191
const importPathParts = relativeFilename.split('/')
192192
if (importPathParts.length > 1) {
193-
content += `import { ${component.displayName} } from '@coreui/${importPathParts[1]}'\n`
193+
content += `import { ${component.displayName} } from '@coreui/${importPathParts[0]}'\n`
194194
}
195195
content += `// or\n`
196-
content += `import ${component.displayName} from '@coreui${relativeFilename.replace('.tsx', '')}'\n`
196+
content += `import ${component.displayName} from '@coreui/${relativeFilename.replace('.tsx', '')}'\n`
197197
content += `\`\`\`\n\n`
198198

199199
const sortedProps = Object.entries(component.props).sort(([a], [b]) => a.localeCompare(b))

0 commit comments

Comments
 (0)