sdocs 0.0.43 → 0.0.44
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 +7 -0
- package/README.md +55 -66
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.44] - 2026-07-04
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- The README documents the block format — the npm listing previously showed
|
|
15
|
+
the retired `export const meta` convention.
|
|
16
|
+
|
|
10
17
|
## [0.0.43] - 2026-07-04
|
|
11
18
|
|
|
12
19
|
### 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
|
-
|
|
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
|
|
103
|
+
### Component docs — `[DOCS]`
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```svelte
|
|
106
|
-
<!-- Button.sdoc -->
|
|
105
|
+
```sdoc
|
|
107
106
|
<script lang="ts">
|
|
108
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
{
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
[example title="With icon"]
|
|
117
|
+
<Button><Icon name="settings" /> Settings</Button>
|
|
118
|
+
[/example]
|
|
119
|
+
|
|
120
|
+
[/DOCS]
|
|
131
121
|
```
|
|
132
122
|
|
|
133
|
-
- **`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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 previews — they 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
|
-
###
|
|
132
|
+
### Pages — `[PAGE]`
|
|
140
133
|
|
|
141
|
-
Freeform content
|
|
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
|
-
```
|
|
144
|
-
|
|
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
|
-
|
|
153
|
-
<p>Install sdocs and create your first doc file.</p>
|
|
141
|
+
## Installation
|
|
154
142
|
|
|
155
|
-
|
|
156
|
-
<p>Run <code>npm install sdocs</code>...</p>
|
|
157
|
-
```
|
|
143
|
+
Run `npm install sdocs` and create your first doc file.
|
|
158
144
|
|
|
159
|
-
|
|
145
|
+
[/PAGE]
|
|
146
|
+
```
|
|
160
147
|
|
|
161
|
-
###
|
|
148
|
+
### Layouts — `[LAYOUT]`
|
|
162
149
|
|
|
163
|
-
|
|
150
|
+
Full-page component compositions rendered on an isolated stage.
|
|
164
151
|
|
|
165
|
-
```
|
|
166
|
-
<!-- LoginForm.layout.sdoc -->
|
|
152
|
+
```sdoc
|
|
167
153
|
<script lang="ts">
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
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
|
|