You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/web/content/docs/concepts/annotations.mdx
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ We can use the `name` of those handlers as comments in the code to use the compo
40
40
41
41
## Annotation Comments
42
42
43
-
We use comments to annotate codeblocks. **The comment syntax depends on the language**. For example, in javascript we use `// !name(1:5)` but in python we use `# !name(1:5)`. For JSON (that doesn't support comments), the recommendation is to instead use `jsonc` or `json5`, which support comments.
43
+
We use comments to annotate codeblocks. **The comment syntax depends on the language**. For example, in javascript we use `// !name(1:5)`, but in python we use `# !name(1:5)`. For JSON (that doesn't support comments), the recommendation is to instead use `jsonc` or `json5`, which support comments.
44
44
45
45
In the previous example we can see the two types of annotations:
46
46
@@ -217,3 +217,9 @@ The regular expressions also support flags The two most common are `g` for globa
217
217
You can also use [capturing groups](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Capturing_group) (see [fold example](/docs/code/fold)):
218
218
219
219
<Demoname="annotations/groups" />
220
+
221
+
## Using start/end comments instead of ranges
222
+
223
+
Instead of counting lines for the range, you can use `!name(start)` and `!name(end)` comments to mark the block:
0 commit comments