-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte CSF Autodoc comments #148
Comments
Parsing JSDoc comments from meta or stories is currently not supported - it would be a good feature request though if you want to make one. There's a workaround where you specify the (markdown) content at It could look something like this: <script context='module'>
import Button from './Button.svelte';
export const meta = {
title: 'Button',
component: Button,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: "your component description here" // 👈👈👈👈👈
}
}
}
}
</script>
<Template let:args>
<Button {...args}>
Click me
</Button>
</Template>
<Story name="Default" parameters={{ docs: { description: {story: "your story-specific description here"} } }}/> See it in action here: https://stackblitz.com/edit/github-7v75vw?file=src%2Fstories%2FButton.stories.svelte |
Validated that this works. Thank you |
Currently, you can add the following to specify the meta of the story in both CSF-svelte files and "normal" [name].stories.ts. Note the inclusion of autodocs.
This results in a correct and expected docs for this story to be created in both cases. However the "normal" .ts story has an additional feature where you can specify a comment on top of a story and let it be rendered as description of a story in the auto docs (see below). I tried to add a comment on top of a CSF story but noticed that the description was missing. Is there a way to add this functionality of comment descriptions in CSF autodocs?
Example of a description by comment in autodoc
The text was updated successfully, but these errors were encountered: