Skip to content
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

Adds a FAQ entry for how to document a svelte component #5131

Merged
merged 3 commits into from
Jul 13, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions site/content/faq/450-how-do-i-document-my-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
question: How do I document my components?
---

In editors which use the Svelte Language Server you can document Components, functions and exports using specially formatted comments.

````svelte
<script>
/** What should we call the user? */
export let name = 'world';
</script>

<!--
@component
Here's some documentation for this component. It will show up
on hover.

- You can use markdown here.
- You can also use code blocks here.
- Usage:
```tsx
<main name="Arethra">
```
-->
<main>
<h1>
Hello, {name}
</h1>
</main>
````

Note: The `@component` is necessary in the HTML comment which describes your component.