Skip to content

Commit

Permalink
cli: add doc template (#2616)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
  • Loading branch information
hywax and benjamincanac authored Nov 12, 2024
1 parent 17170bb commit e48b416
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion cli/templates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,53 @@ describe('${upperName}', () => {
}
}

const doc = ({ name, pro }) => {
const kebabName = kebabCase(name)
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')

return {
filename: `docs/content/${pro ? 'pro' : '3.components'}/${kebabName}.md`,
contents: `---
description:
links: ${pro
? ''
: `- label: ${upperName}
icon: i-custom-radix-vue
to: https://www.radix-vue.com/components/${kebabName}.html`}
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxt/${pro ? 'ui-pro' : 'ui'}/tree/v3/src/runtime/components/${upperName}.vue
---
## Usage
## Examples
## API
### Props
:component-props
### Slots
:component-slots
### Emits
:component-emits
## Theme
:component-theme
`
}
}

export default {
playground,
component,
theme,
test
test,
doc
}

0 comments on commit e48b416

Please sign in to comment.