Skip to content

Commit

Permalink
docs: add component comments (#7376)
Browse files Browse the repository at this point in the history
* docs: add component comments

* Review: copy on IDE

Co-authored-by: Ben McCann <[email protected]>

* Review: conventions/brevity

Co-authored-by: Ben McCann <[email protected]>

---------

Co-authored-by: Ben McCann <[email protected]>
  • Loading branch information
metonym and benmccann authored Dec 3, 2024
1 parent bf84b5b commit 6045028
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions documentation/docs/02-template-syntax/02-basic-markup.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,12 @@ Comments beginning with `svelte-ignore` disable warnings for the next block of m
<!-- svelte-ignore a11y-autofocus -->
<input bind:value={name} autofocus />
```

You can document components with the `@component` tag. These comments will appear when hovering over a component in IDEs with support such as VS Code with [the Svelte VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).

```svelte
<!--
@component this is a component description
-->
<h1>Hello world</h1>
```

0 comments on commit 6045028

Please sign in to comment.