sdocs 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.45] - 2026-07-04
11
+
12
+ ### Fixed
13
+
14
+ - **The sdoc grammar survives multi-block files.** The embedded Svelte
15
+ grammar opens a text region after any line ending in `>` that only closes
16
+ at the next `<` or `{` — it swallowed block closers, leaving everything
17
+ after the first `[preview]` uncolored. Block bodies now embed Svelte
18
+ behind line-guarded regions (the mechanism markdown fences use), so
19
+ closers, sibling blocks, and later entities all highlight correctly.
20
+
21
+ ## [0.0.44] - 2026-07-04
22
+
23
+ ### Changed
24
+
25
+ - The README documents the block format — the npm listing previously showed
26
+ the retired `export const meta` convention.
27
+
10
28
  ## [0.0.43] - 2026-07-04
11
29
 
12
30
  ### Added
package/README.md CHANGED
@@ -96,93 +96,80 @@ That's it — your docs page lives at `/docs` inside your existing app.
96
96
 
97
97
  ## Writing Docs
98
98
 
99
- sdocs supports three types of doc files:
99
+ A `.sdoc` file is `<script>` at the top, entity blocks in the middle, and an
100
+ optional `<style>` at the bottom. Every entity is its own sidebar entry, so
101
+ one file can hold several.
100
102
 
101
- ### Component Docs (`.sdoc`)
103
+ ### Component docs `[DOCS]`
102
104
 
103
- Document a Svelte component with interactive controls and examples.
104
-
105
- ```svelte
106
- <!-- Button.sdoc -->
105
+ ```sdoc
107
106
  <script lang="ts">
108
- import Button from './Button.svelte';
109
-
110
- export const meta = {
111
- component: Button,
112
- title: 'Components / Button',
113
- description: 'A flexible button component.',
114
- args: {
115
- label: 'Click me',
116
- size: 'md',
117
- disabled: false,
118
- },
119
- };
107
+ import Button from './Button.svelte';
120
108
  </script>
121
109
 
122
- {#snippet Default()}
123
- <Button {...args} />
124
- {/snippet}
110
+ [DOCS title="Components / Button" description="A flexible button component."]
111
+
112
+ [preview component={Button} args={{ label: 'Click me', disabled: false }}]
113
+ <Button {...args} />
114
+ [/preview]
125
115
 
126
- {#snippet WithIcon()}
127
- <Button>
128
- <Icon name="settings" /> Settings
129
- </Button>
130
- {/snippet}
116
+ [example title="With icon"]
117
+ <Button><Icon name="settings" /> Settings</Button>
118
+ [/example]
119
+
120
+ [/DOCS]
131
121
  ```
132
122
 
133
- - **`component`** — the Svelte component to document (auto-extracts props, events, snippets, methods, state, CSS custom properties)
134
- - **`title`** slash-separated path for sidebar navigation (e.g. `'Components / Button'`)
135
- - **`args`** — default prop values, used as initial values for interactive controls
136
- - **`Default` snippet** gets live interactive controls. Auto-generated as `<Component {...args} />` if omitted.
137
- - **Named snippets**static examples listed in the sidebar
123
+ - **`[preview]`** — a live showcase with interactive controls.
124
+ `component={X}` names the previewed component (its props, events,
125
+ snippets, methods, state, and CSS custom properties are extracted
126
+ automatically) and `args` sets the control defaults. A `[DOCS]` block can
127
+ hold several previewsthey render as tabs, each fully live.
128
+ - **`[example]`** — frozen showcases rendered exactly as written, shown
129
+ below the preview area. Each needs a unique `title`.
130
+ - **`title`** — slash-separated path for sidebar navigation.
138
131
 
139
- ### Page Docs (`.page.sdoc`)
132
+ ### Pages `[PAGE]`
140
133
 
141
- Freeform content pages with auto-generated table of contents.
134
+ Freeform markdown content with `{expression}` interpolation and Svelte
135
+ component islands; code fences are inert. The table of contents is generated
136
+ from the headings.
142
137
 
143
- ```svelte
144
- <!-- GettingStarted.page.sdoc -->
145
- <script lang="ts">
146
- export const meta = {
147
- title: 'Docs / Getting Started',
148
- description: 'How to set up sdocs.',
149
- };
150
- </script>
138
+ ```sdoc
139
+ [PAGE title="Docs / Getting Started"]
151
140
 
152
- <h1>Getting Started</h1>
153
- <p>Install sdocs and create your first doc file.</p>
141
+ ## Installation
154
142
 
155
- <h2>Installation</h2>
156
- <p>Run <code>npm install sdocs</code>...</p>
157
- ```
143
+ Run `npm install sdocs` and create your first doc file.
158
144
 
159
- Table of contents is auto-generated from `<h2>`, `<h3>`, and `<h4>` headings.
145
+ [/PAGE]
146
+ ```
160
147
 
161
- ### Layout Docs (`.layout.sdoc`)
148
+ ### Layouts `[LAYOUT]`
162
149
 
163
- Component compositions rendered in an isolated iframe.
150
+ Full-page component compositions rendered on an isolated stage.
164
151
 
165
- ```svelte
166
- <!-- LoginForm.layout.sdoc -->
152
+ ```sdoc
167
153
  <script lang="ts">
168
- import Card from './Card.svelte';
169
- import Input from './Input.svelte';
170
- import Button from './Button.svelte';
171
-
172
- export const meta = {
173
- title: 'Patterns / Login Form',
174
- description: 'A login form combining multiple components.',
175
- settings: { padding: '24px' },
176
- };
154
+ import Card from './Card.svelte';
155
+ import Input from './Input.svelte';
156
+ import Button from './Button.svelte';
177
157
  </script>
178
158
 
179
- <Card padding="24px">
180
- <Input label="Email" type="email" />
181
- <Input label="Password" type="password" />
182
- <Button>Sign in</Button>
183
- </Card>
159
+ [LAYOUT title="Patterns / Login Form" padding="24px"]
160
+
161
+ <Card padding="24px">
162
+ <Input label="Email" type="email" />
163
+ <Input label="Password" type="password" />
164
+ <Button>Sign in</Button>
165
+ </Card>
166
+
167
+ [/LAYOUT]
184
168
  ```
185
169
 
170
+ The full language reference lives at
171
+ [gabilungu.github.io/sdocs/language](https://gabilungu.github.io/sdocs/language).
172
+
186
173
  ## Prop Extraction
187
174
 
188
175
  sdocs automatically extracts from your Svelte components:
@@ -200,7 +187,7 @@ JSDoc comments on props are picked up as descriptions.
200
187
 
201
188
  ## Interactive Controls
202
189
 
203
- The Default snippet gets live controls based on prop types:
190
+ Each preview gets live controls based on prop types:
204
191
 
205
192
  | Prop Type | Control |
206
193
  |-----------|---------|
@@ -275,6 +262,8 @@ sidebar: {
275
262
  | `sdocs/vite` | Vite plugin function |
276
263
  | `sdocs/explorer` | Explorer.svelte UI component |
277
264
  | `sdocs/ui` | Reusable UI components (Button, Frame, Icon, Control, NavTree, Stack) |
265
+ | `sdocs/language` | The sdoc scanner, parser, and Svelte projection |
266
+ | `sdocs/grammar/sdoc.tmLanguage.json` | TextMate grammar for editors and highlighters |
278
267
 
279
268
  ## License
280
269
 
@@ -2,15 +2,31 @@
2
2
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
3
  "name": "sdoc",
4
4
  "scopeName": "source.sdoc",
5
- "fileTypes": ["sdoc"],
5
+ "fileTypes": [
6
+ "sdoc"
7
+ ],
6
8
  "patterns": [
7
- { "include": "#comment" },
8
- { "include": "#script-ts" },
9
- { "include": "#script-js" },
10
- { "include": "#style" },
11
- { "include": "#docs" },
12
- { "include": "#page" },
13
- { "include": "#layout" }
9
+ {
10
+ "include": "#comment"
11
+ },
12
+ {
13
+ "include": "#script-ts"
14
+ },
15
+ {
16
+ "include": "#script-js"
17
+ },
18
+ {
19
+ "include": "#style"
20
+ },
21
+ {
22
+ "include": "#docs"
23
+ },
24
+ {
25
+ "include": "#page"
26
+ },
27
+ {
28
+ "include": "#layout"
29
+ }
14
30
  ],
15
31
  "repository": {
16
32
  "comment": {
@@ -19,204 +35,415 @@
19
35
  "end": "-->"
20
36
  },
21
37
  "script-ts": {
22
- "begin": "^\\s*(<)(script)(?=[^>]*lang=([\"'])ts\\3)",
38
+ "begin": "^\\s*(<)(script)((?=[^>]*lang=([\"'])ts\\4)[^>]*)(>)",
23
39
  "beginCaptures": {
24
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
25
- "2": { "name": "entity.name.tag.script.sdoc" }
40
+ "1": {
41
+ "name": "punctuation.definition.tag.begin.sdoc"
42
+ },
43
+ "2": {
44
+ "name": "entity.name.tag.script.sdoc"
45
+ },
46
+ "3": {
47
+ "patterns": [
48
+ {
49
+ "include": "#tag-attributes"
50
+ }
51
+ ]
52
+ },
53
+ "5": {
54
+ "name": "punctuation.definition.tag.end.sdoc"
55
+ }
26
56
  },
27
57
  "end": "(</)(script)\\s*(>)",
28
58
  "endCaptures": {
29
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
30
- "2": { "name": "entity.name.tag.script.sdoc" },
31
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
59
+ "1": {
60
+ "name": "punctuation.definition.tag.begin.sdoc"
61
+ },
62
+ "2": {
63
+ "name": "entity.name.tag.script.sdoc"
64
+ },
65
+ "3": {
66
+ "name": "punctuation.definition.tag.end.sdoc"
67
+ }
32
68
  },
69
+ "contentName": "source.ts",
33
70
  "patterns": [
34
- { "include": "#tag-rest" },
35
71
  {
36
- "begin": "(?<=>)",
37
- "end": "(?=</script)",
38
- "contentName": "source.ts",
39
- "patterns": [{ "include": "source.ts" }]
72
+ "include": "source.ts"
40
73
  }
41
74
  ]
42
75
  },
43
76
  "script-js": {
44
- "begin": "^\\s*(<)(script)(?![^>]*lang=([\"'])ts\\3)(?=[\\s>])",
77
+ "begin": "^\\s*(<)(script)((?![^>]*lang=([\"'])ts\\4)[^>]*)(>)",
45
78
  "beginCaptures": {
46
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
47
- "2": { "name": "entity.name.tag.script.sdoc" }
79
+ "1": {
80
+ "name": "punctuation.definition.tag.begin.sdoc"
81
+ },
82
+ "2": {
83
+ "name": "entity.name.tag.script.sdoc"
84
+ },
85
+ "3": {
86
+ "patterns": [
87
+ {
88
+ "include": "#tag-attributes"
89
+ }
90
+ ]
91
+ },
92
+ "5": {
93
+ "name": "punctuation.definition.tag.end.sdoc"
94
+ }
48
95
  },
49
96
  "end": "(</)(script)\\s*(>)",
50
97
  "endCaptures": {
51
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
52
- "2": { "name": "entity.name.tag.script.sdoc" },
53
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
98
+ "1": {
99
+ "name": "punctuation.definition.tag.begin.sdoc"
100
+ },
101
+ "2": {
102
+ "name": "entity.name.tag.script.sdoc"
103
+ },
104
+ "3": {
105
+ "name": "punctuation.definition.tag.end.sdoc"
106
+ }
54
107
  },
108
+ "contentName": "source.js",
55
109
  "patterns": [
56
- { "include": "#tag-rest" },
57
110
  {
58
- "begin": "(?<=>)",
59
- "end": "(?=</script)",
60
- "contentName": "source.js",
61
- "patterns": [{ "include": "source.js" }]
111
+ "include": "source.js"
62
112
  }
63
113
  ]
64
114
  },
65
115
  "style": {
66
- "begin": "^\\s*(<)(style)(?=[\\s>])",
116
+ "begin": "^\\s*(<)(style)([^>]*)(>)",
67
117
  "beginCaptures": {
68
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
69
- "2": { "name": "entity.name.tag.style.sdoc" }
118
+ "1": {
119
+ "name": "punctuation.definition.tag.begin.sdoc"
120
+ },
121
+ "2": {
122
+ "name": "entity.name.tag.style.sdoc"
123
+ },
124
+ "3": {
125
+ "patterns": [
126
+ {
127
+ "include": "#tag-attributes"
128
+ }
129
+ ]
130
+ },
131
+ "4": {
132
+ "name": "punctuation.definition.tag.end.sdoc"
133
+ }
70
134
  },
71
135
  "end": "(</)(style)\\s*(>)",
72
136
  "endCaptures": {
73
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
74
- "2": { "name": "entity.name.tag.style.sdoc" },
75
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
137
+ "1": {
138
+ "name": "punctuation.definition.tag.begin.sdoc"
139
+ },
140
+ "2": {
141
+ "name": "entity.name.tag.style.sdoc"
142
+ },
143
+ "3": {
144
+ "name": "punctuation.definition.tag.end.sdoc"
145
+ }
76
146
  },
147
+ "contentName": "source.css",
77
148
  "patterns": [
78
- { "include": "#tag-rest" },
79
149
  {
80
- "begin": "(?<=>)",
81
- "end": "(?=</style)",
82
- "contentName": "source.css",
83
- "patterns": [{ "include": "source.css" }]
150
+ "include": "source.css"
84
151
  }
85
152
  ]
86
153
  },
87
- "tag-rest": {
88
- "begin": "\\G",
89
- "end": "(>)",
90
- "endCaptures": {
91
- "1": { "name": "punctuation.definition.tag.end.sdoc" }
92
- },
93
- "patterns": [{ "include": "#attributes" }]
94
- },
95
154
  "docs": {
96
155
  "name": "meta.block.docs.sdoc",
97
- "begin": "^\\s*(\\[)(DOCS)\\b",
156
+ "begin": "^\\s*(\\[)(DOCS)\\b(.*)$",
98
157
  "beginCaptures": {
99
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
100
- "2": { "name": "keyword.control.entity.sdoc" }
158
+ "1": {
159
+ "name": "punctuation.definition.tag.begin.sdoc"
160
+ },
161
+ "2": {
162
+ "name": "keyword.control.entity.sdoc"
163
+ },
164
+ "3": {
165
+ "patterns": [
166
+ {
167
+ "include": "#attributes"
168
+ }
169
+ ]
170
+ }
101
171
  },
102
172
  "end": "^\\s*(\\[/)(DOCS)(\\])\\s*$",
103
173
  "endCaptures": {
104
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
105
- "2": { "name": "keyword.control.entity.sdoc" },
106
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
174
+ "1": {
175
+ "name": "punctuation.definition.tag.begin.sdoc"
176
+ },
177
+ "2": {
178
+ "name": "keyword.control.entity.sdoc"
179
+ },
180
+ "3": {
181
+ "name": "punctuation.definition.tag.end.sdoc"
182
+ }
107
183
  },
108
184
  "patterns": [
109
- { "include": "#opener-attrs" },
110
- { "include": "#comment" },
111
- { "include": "#preview" },
112
- { "include": "#example" }
185
+ {
186
+ "include": "#comment"
187
+ },
188
+ {
189
+ "include": "#opener-continuation"
190
+ },
191
+ {
192
+ "include": "#preview"
193
+ },
194
+ {
195
+ "include": "#example"
196
+ }
113
197
  ]
114
198
  },
115
199
  "page": {
116
200
  "name": "meta.block.page.sdoc",
117
- "begin": "^\\s*(\\[)(PAGE)\\b",
201
+ "begin": "^\\s*(\\[)(PAGE)\\b(.*)$",
118
202
  "beginCaptures": {
119
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
120
- "2": { "name": "keyword.control.entity.sdoc" }
203
+ "1": {
204
+ "name": "punctuation.definition.tag.begin.sdoc"
205
+ },
206
+ "2": {
207
+ "name": "keyword.control.entity.sdoc"
208
+ },
209
+ "3": {
210
+ "patterns": [
211
+ {
212
+ "include": "#attributes"
213
+ }
214
+ ]
215
+ }
121
216
  },
122
217
  "end": "^\\s*(\\[/)(PAGE)(\\])\\s*$",
123
218
  "endCaptures": {
124
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
125
- "2": { "name": "keyword.control.entity.sdoc" },
126
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
219
+ "1": {
220
+ "name": "punctuation.definition.tag.begin.sdoc"
221
+ },
222
+ "2": {
223
+ "name": "keyword.control.entity.sdoc"
224
+ },
225
+ "3": {
226
+ "name": "punctuation.definition.tag.end.sdoc"
227
+ }
127
228
  },
128
229
  "patterns": [
129
- { "include": "#opener-attrs" },
130
- { "include": "source.svelte" }
230
+ {
231
+ "begin": "(^|\\G)",
232
+ "while": "(^|\\G)(?!\\s*\\[/PAGE\\]\\s*$)",
233
+ "patterns": [
234
+ {
235
+ "include": "source.svelte"
236
+ }
237
+ ]
238
+ }
131
239
  ]
132
240
  },
133
241
  "layout": {
134
242
  "name": "meta.block.layout.sdoc",
135
- "begin": "^\\s*(\\[)(LAYOUT)\\b",
243
+ "begin": "^\\s*(\\[)(LAYOUT)\\b(.*)$",
136
244
  "beginCaptures": {
137
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
138
- "2": { "name": "keyword.control.entity.sdoc" }
245
+ "1": {
246
+ "name": "punctuation.definition.tag.begin.sdoc"
247
+ },
248
+ "2": {
249
+ "name": "keyword.control.entity.sdoc"
250
+ },
251
+ "3": {
252
+ "patterns": [
253
+ {
254
+ "include": "#attributes"
255
+ }
256
+ ]
257
+ }
139
258
  },
140
259
  "end": "^\\s*(\\[/)(LAYOUT)(\\])\\s*$",
141
260
  "endCaptures": {
142
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
143
- "2": { "name": "keyword.control.entity.sdoc" },
144
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
261
+ "1": {
262
+ "name": "punctuation.definition.tag.begin.sdoc"
263
+ },
264
+ "2": {
265
+ "name": "keyword.control.entity.sdoc"
266
+ },
267
+ "3": {
268
+ "name": "punctuation.definition.tag.end.sdoc"
269
+ }
145
270
  },
146
271
  "patterns": [
147
- { "include": "#opener-attrs" },
148
- { "include": "source.svelte" }
272
+ {
273
+ "begin": "(^|\\G)",
274
+ "while": "(^|\\G)(?!\\s*\\[/LAYOUT\\]\\s*$)",
275
+ "patterns": [
276
+ {
277
+ "include": "source.svelte"
278
+ }
279
+ ]
280
+ }
149
281
  ]
150
282
  },
151
283
  "preview": {
152
284
  "name": "meta.block.preview.sdoc",
153
- "begin": "^\\s*(\\[)(preview)\\b",
285
+ "begin": "^\\s*(\\[)(preview)\\b(.*)$",
154
286
  "beginCaptures": {
155
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
156
- "2": { "name": "entity.name.tag.sdoc" }
287
+ "1": {
288
+ "name": "punctuation.definition.tag.begin.sdoc"
289
+ },
290
+ "2": {
291
+ "name": "entity.name.tag.sdoc"
292
+ },
293
+ "3": {
294
+ "patterns": [
295
+ {
296
+ "include": "#attributes"
297
+ }
298
+ ]
299
+ }
157
300
  },
158
301
  "end": "^\\s*(\\[/)(preview)(\\])\\s*$",
159
302
  "endCaptures": {
160
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
161
- "2": { "name": "entity.name.tag.sdoc" },
162
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
303
+ "1": {
304
+ "name": "punctuation.definition.tag.begin.sdoc"
305
+ },
306
+ "2": {
307
+ "name": "entity.name.tag.sdoc"
308
+ },
309
+ "3": {
310
+ "name": "punctuation.definition.tag.end.sdoc"
311
+ }
163
312
  },
164
313
  "patterns": [
165
- { "include": "#opener-attrs" },
166
- { "include": "source.svelte" }
314
+ {
315
+ "begin": "(^|\\G)",
316
+ "while": "(^|\\G)(?!\\s*\\[/preview\\]\\s*$)",
317
+ "patterns": [
318
+ {
319
+ "include": "source.svelte"
320
+ }
321
+ ]
322
+ }
167
323
  ]
168
324
  },
169
325
  "example": {
170
326
  "name": "meta.block.example.sdoc",
171
- "begin": "^\\s*(\\[)(example)\\b",
327
+ "begin": "^\\s*(\\[)(example)\\b(.*)$",
172
328
  "beginCaptures": {
173
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
174
- "2": { "name": "entity.name.tag.sdoc" }
329
+ "1": {
330
+ "name": "punctuation.definition.tag.begin.sdoc"
331
+ },
332
+ "2": {
333
+ "name": "entity.name.tag.sdoc"
334
+ },
335
+ "3": {
336
+ "patterns": [
337
+ {
338
+ "include": "#attributes"
339
+ }
340
+ ]
341
+ }
175
342
  },
176
343
  "end": "^\\s*(\\[/)(example)(\\])\\s*$",
177
344
  "endCaptures": {
178
- "1": { "name": "punctuation.definition.tag.begin.sdoc" },
179
- "2": { "name": "entity.name.tag.sdoc" },
180
- "3": { "name": "punctuation.definition.tag.end.sdoc" }
345
+ "1": {
346
+ "name": "punctuation.definition.tag.begin.sdoc"
347
+ },
348
+ "2": {
349
+ "name": "entity.name.tag.sdoc"
350
+ },
351
+ "3": {
352
+ "name": "punctuation.definition.tag.end.sdoc"
353
+ }
181
354
  },
182
355
  "patterns": [
183
- { "include": "#opener-attrs" },
184
- { "include": "source.svelte" }
356
+ {
357
+ "begin": "(^|\\G)",
358
+ "while": "(^|\\G)(?!\\s*\\[/example\\]\\s*$)",
359
+ "patterns": [
360
+ {
361
+ "include": "source.svelte"
362
+ }
363
+ ]
364
+ }
185
365
  ]
186
366
  },
187
- "opener-attrs": {
188
- "begin": "\\G",
189
- "end": "(\\])",
190
- "endCaptures": {
191
- "1": { "name": "punctuation.definition.tag.end.sdoc" }
192
- },
193
- "patterns": [{ "include": "#attributes" }]
367
+ "opener-continuation": {
368
+ "comment": "Attribute lines of a multi-line opener: lines before the block body that end the opener or continue it.",
369
+ "match": "^\\s*((?:[A-Za-z_][\\w-]*\\s*=.*)?)(\\])\\s*$",
370
+ "captures": {
371
+ "1": {
372
+ "patterns": [
373
+ {
374
+ "include": "#attributes"
375
+ }
376
+ ]
377
+ },
378
+ "2": {
379
+ "name": "punctuation.definition.tag.end.sdoc"
380
+ }
381
+ }
382
+ },
383
+ "tag-attributes": {
384
+ "patterns": [
385
+ {
386
+ "match": "([A-Za-z_][\\w:-]*)(=)?",
387
+ "captures": {
388
+ "1": {
389
+ "name": "entity.other.attribute-name.sdoc"
390
+ },
391
+ "2": {
392
+ "name": "punctuation.separator.key-value.sdoc"
393
+ }
394
+ }
395
+ },
396
+ {
397
+ "name": "string.quoted.double.sdoc",
398
+ "begin": "\"",
399
+ "end": "\""
400
+ },
401
+ {
402
+ "name": "string.quoted.single.sdoc",
403
+ "begin": "'",
404
+ "end": "'"
405
+ }
406
+ ]
194
407
  },
195
408
  "attributes": {
196
409
  "patterns": [
197
410
  {
198
411
  "match": "([A-Za-z_][\\w-]*)\\s*(=)",
199
412
  "captures": {
200
- "1": { "name": "entity.other.attribute-name.sdoc" },
201
- "2": { "name": "punctuation.separator.key-value.sdoc" }
413
+ "1": {
414
+ "name": "entity.other.attribute-name.sdoc"
415
+ },
416
+ "2": {
417
+ "name": "punctuation.separator.key-value.sdoc"
418
+ }
202
419
  }
203
420
  },
204
421
  {
205
- "match": "([A-Za-z_][\\w-]*)",
206
- "name": "entity.other.attribute-name.sdoc"
422
+ "match": "\\]\\s*$",
423
+ "name": "punctuation.definition.tag.end.sdoc"
207
424
  },
208
425
  {
209
426
  "name": "string.quoted.double.sdoc",
210
427
  "begin": "\"",
211
428
  "end": "\"",
212
429
  "beginCaptures": {
213
- "0": { "name": "punctuation.definition.string.begin.sdoc" }
430
+ "0": {
431
+ "name": "punctuation.definition.string.begin.sdoc"
432
+ }
214
433
  },
215
434
  "endCaptures": {
216
- "0": { "name": "punctuation.definition.string.end.sdoc" }
435
+ "0": {
436
+ "name": "punctuation.definition.string.end.sdoc"
437
+ }
217
438
  }
218
439
  },
219
- { "include": "#expression" }
440
+ {
441
+ "include": "#expression"
442
+ },
443
+ {
444
+ "match": "([A-Za-z_][\\w-]*)",
445
+ "name": "entity.other.attribute-name.sdoc"
446
+ }
220
447
  ]
221
448
  },
222
449
  "expression": {
@@ -224,21 +451,35 @@
224
451
  "begin": "\\{",
225
452
  "end": "\\}",
226
453
  "beginCaptures": {
227
- "0": { "name": "punctuation.section.embedded.begin.sdoc" }
454
+ "0": {
455
+ "name": "punctuation.section.embedded.begin.sdoc"
456
+ }
228
457
  },
229
458
  "endCaptures": {
230
- "0": { "name": "punctuation.section.embedded.end.sdoc" }
459
+ "0": {
460
+ "name": "punctuation.section.embedded.end.sdoc"
461
+ }
231
462
  },
232
- "patterns": [{ "include": "#expression-inner" }]
463
+ "patterns": [
464
+ {
465
+ "include": "#expression-inner"
466
+ }
467
+ ]
233
468
  },
234
469
  "expression-inner": {
235
470
  "patterns": [
236
471
  {
237
472
  "begin": "\\{",
238
473
  "end": "\\}",
239
- "patterns": [{ "include": "#expression-inner" }]
474
+ "patterns": [
475
+ {
476
+ "include": "#expression-inner"
477
+ }
478
+ ]
240
479
  },
241
- { "include": "source.ts" }
480
+ {
481
+ "include": "source.ts"
482
+ }
242
483
  ]
243
484
  }
244
485
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdocs",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "A lightweight documentation tool for Svelte 5 components",
5
5
  "type": "module",
6
6
  "license": "MIT",