@offorte/show-doc 0.0.3 → 0.0.4
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/README.md +56 -2
- package/custom-elements.json +90 -4
- package/dist/showdoc-mermaid.js +23664 -23983
- package/dist/showdoc.js +263 -578
- package/dist/types/components/shw-code.d.ts +19 -2
- package/dist/types/components/shw-collapsible.d.ts +7 -1
- package/package.json +1 -1
- package/skills/show-doc/SKILL.md +127 -36
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
ShowDoc is an agent skill for Codex, Claude Code, and other compatible coding agents. It replaces
|
|
6
6
|
separate Markdown and HTML versions with one shared HTML artifact for agents and people.
|
|
7
7
|
|
|
8
|
-
An agent writes compact Markdown and semantic `shw-*` elements. One
|
|
8
|
+
An agent writes compact Markdown and semantic `shw-*` elements. One JavaScript include
|
|
9
9
|
provides the components, Markdown rendering, presentation DOM, and CSS.
|
|
10
10
|
|
|
11
11
|
The source DOM stays small and focused on content. Agents can read and update it without sorting
|
|
@@ -50,6 +50,56 @@ Use ShowDoc for:
|
|
|
50
50
|
ShowDoc is not intended for dashboards, forms, modals, or large interactive tools. Those need their
|
|
51
51
|
own application code.
|
|
52
52
|
|
|
53
|
+
## Plans and change recaps
|
|
54
|
+
|
|
55
|
+
Build a plan from an outcome, a focused comparison or diagram, and steps with clear checks. Build
|
|
56
|
+
a recap from the resulting behavior, a real change excerpt, and the checks that actually ran.
|
|
57
|
+
Existing grids, sections, cards, figures, and tables supply the structure.
|
|
58
|
+
|
|
59
|
+
For code, `shw-code` supports `language="diff"` for supplied unified patches, `line-numbers`,
|
|
60
|
+
`highlight="2,4-6"`, and notes tied to lines:
|
|
61
|
+
|
|
62
|
+
<!-- prettier-ignore -->
|
|
63
|
+
```html
|
|
64
|
+
<shw-code
|
|
65
|
+
filename="save.ts"
|
|
66
|
+
language="ts"
|
|
67
|
+
line-numbers
|
|
68
|
+
highlight="2"
|
|
69
|
+
annotations='[{"start":2,"text":"Clear the draft only after the save succeeds."}]'
|
|
70
|
+
>
|
|
71
|
+
await save(draft);
|
|
72
|
+
clearDraft();
|
|
73
|
+
</shw-code>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Annotations are a JSON array of `start`, optional `end`, and Markdown `text`. Line references are
|
|
77
|
+
1-based positions in the displayed excerpt, including any diff headers. They are not file line
|
|
78
|
+
numbers. Invalid JSON or ranges show an authoring message without hiding the source. Notes remain
|
|
79
|
+
visible below the code. ShowDoc does not fetch source, compute changes, or verify claims.
|
|
80
|
+
|
|
81
|
+
Use `shw-collapsible content="blocks"` for expandable evidence that contains other components:
|
|
82
|
+
|
|
83
|
+
<!-- prettier-ignore -->
|
|
84
|
+
```html
|
|
85
|
+
<shw-collapsible summary="Supporting evidence" content="blocks">
|
|
86
|
+
<shw-code filename="save.ts" language="ts">await save(draft);</shw-code>
|
|
87
|
+
<shw-table caption="Checks">
|
|
88
|
+
Check | Result
|
|
89
|
+
Save retry | Not run
|
|
90
|
+
</shw-table>
|
|
91
|
+
</shw-collapsible>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The default disclosure body remains Markdown. In blocks mode, wrap prose in `shw-markdown`.
|
|
95
|
+
The [authoring skill](./skills/show-doc/SKILL.md) includes plan and recap recipes, comparison
|
|
96
|
+
guidance, source escaping rules, and the full compact API.
|
|
97
|
+
|
|
98
|
+
Documents default to light mode, regardless of the system theme. The theme uses a clear title,
|
|
99
|
+
restrained accents, distinct metrics, and subtle surface contrast.
|
|
100
|
+
Use visual variety to explain the content: short comparisons in a grid, wide evidence in a full
|
|
101
|
+
section, and secondary detail in a disclosure. Keep uncertain results and open decisions explicit.
|
|
102
|
+
|
|
53
103
|
## Install the skill
|
|
54
104
|
|
|
55
105
|
After you download or clone this repository, copy the complete [`skills/show-doc`](./skills/show-doc/)
|
|
@@ -77,10 +127,14 @@ Ask your agent for the document you need:
|
|
|
77
127
|
|
|
78
128
|
> Use the ShowDoc skill to create a visual project update.
|
|
79
129
|
|
|
80
|
-
The [`show-doc` skill](./skills/show-doc/SKILL.md) contains the
|
|
130
|
+
The [`show-doc` skill](./skills/show-doc/SKILL.md) contains the runtime setup,
|
|
81
131
|
component reference, and authoring rules. It creates the complete HTML file for you. You do not need
|
|
82
132
|
to choose a CDN script or write setup code.
|
|
83
133
|
|
|
134
|
+
The skill uses `@latest` CDN URLs by default, so generated documents can receive future published
|
|
135
|
+
updates. Ask for an exact version when a document needs to keep the same runtime. The released
|
|
136
|
+
showcase stays pinned to its matching package version.
|
|
137
|
+
|
|
84
138
|
## Safety
|
|
85
139
|
|
|
86
140
|
ShowDoc uses Micromark with safe defaults. Raw HTML and dangerous URL protocols are not enabled in
|
package/custom-elements.json
CHANGED
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"kind": "class",
|
|
185
|
-
"description": "Shows a
|
|
185
|
+
"description": "Shows code or a supplied unified diff, with optional source line numbers and notes.",
|
|
186
186
|
"name": "ShwCode",
|
|
187
187
|
"members": [
|
|
188
188
|
{
|
|
@@ -204,8 +204,41 @@
|
|
|
204
204
|
"text": "string"
|
|
205
205
|
},
|
|
206
206
|
"default": "\"text\"",
|
|
207
|
-
"description": "Syntax language
|
|
207
|
+
"description": "Syntax language: html, js, ts, json, or diff for a supplied unified diff.",
|
|
208
208
|
"attribute": "language"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"kind": "field",
|
|
212
|
+
"name": "lineNumbers",
|
|
213
|
+
"privacy": "public",
|
|
214
|
+
"type": {
|
|
215
|
+
"text": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"default": "false",
|
|
218
|
+
"description": "Show 1-based positions in the displayed source, including diff headers.",
|
|
219
|
+
"attribute": "line-numbers"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"kind": "field",
|
|
223
|
+
"name": "highlight",
|
|
224
|
+
"privacy": "public",
|
|
225
|
+
"type": {
|
|
226
|
+
"text": "string"
|
|
227
|
+
},
|
|
228
|
+
"default": "\"\"",
|
|
229
|
+
"description": "Source lines to emphasize, for example 2,4-6.",
|
|
230
|
+
"attribute": "highlight"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"kind": "field",
|
|
234
|
+
"name": "annotations",
|
|
235
|
+
"privacy": "public",
|
|
236
|
+
"type": {
|
|
237
|
+
"text": "string"
|
|
238
|
+
},
|
|
239
|
+
"default": "\"\"",
|
|
240
|
+
"description": "JSON array of { start, end?, text } notes. Text is safe Markdown; lines are 1-based.",
|
|
241
|
+
"attribute": "annotations"
|
|
209
242
|
}
|
|
210
243
|
],
|
|
211
244
|
"attributes": [
|
|
@@ -224,8 +257,35 @@
|
|
|
224
257
|
"text": "string"
|
|
225
258
|
},
|
|
226
259
|
"default": "\"text\"",
|
|
227
|
-
"description": "Syntax language
|
|
260
|
+
"description": "Syntax language: html, js, ts, json, or diff for a supplied unified diff.",
|
|
228
261
|
"fieldName": "language"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "line-numbers",
|
|
265
|
+
"type": {
|
|
266
|
+
"text": "boolean"
|
|
267
|
+
},
|
|
268
|
+
"default": "false",
|
|
269
|
+
"description": "Show 1-based positions in the displayed source, including diff headers.",
|
|
270
|
+
"fieldName": "lineNumbers"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "highlight",
|
|
274
|
+
"type": {
|
|
275
|
+
"text": "string"
|
|
276
|
+
},
|
|
277
|
+
"default": "\"\"",
|
|
278
|
+
"description": "Source lines to emphasize, for example 2,4-6.",
|
|
279
|
+
"fieldName": "highlight"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "annotations",
|
|
283
|
+
"type": {
|
|
284
|
+
"text": "string"
|
|
285
|
+
},
|
|
286
|
+
"default": "\"\"",
|
|
287
|
+
"description": "JSON array of { start, end?, text } notes. Text is safe Markdown; lines are 1-based.",
|
|
288
|
+
"fieldName": "annotations"
|
|
229
289
|
}
|
|
230
290
|
],
|
|
231
291
|
"superclass": {
|
|
@@ -237,8 +297,14 @@
|
|
|
237
297
|
},
|
|
238
298
|
{
|
|
239
299
|
"kind": "class",
|
|
240
|
-
"description": "Hides optional Markdown
|
|
300
|
+
"description": "Hides optional Markdown or child document blocks behind a native disclosure control.",
|
|
241
301
|
"name": "ShwCollapsible",
|
|
302
|
+
"slots": [
|
|
303
|
+
{
|
|
304
|
+
"description": "Document blocks when content=\"blocks\".",
|
|
305
|
+
"name": ""
|
|
306
|
+
}
|
|
307
|
+
],
|
|
242
308
|
"members": [
|
|
243
309
|
{
|
|
244
310
|
"kind": "field",
|
|
@@ -262,9 +328,29 @@
|
|
|
262
328
|
"default": "\"Details\"",
|
|
263
329
|
"description": "Label for the disclosure control.",
|
|
264
330
|
"attribute": "summary"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"kind": "field",
|
|
334
|
+
"name": "content",
|
|
335
|
+
"privacy": "public",
|
|
336
|
+
"type": {
|
|
337
|
+
"text": "\"markdown\" | \"blocks\""
|
|
338
|
+
},
|
|
339
|
+
"default": "\"markdown\"",
|
|
340
|
+
"description": "Body input: Markdown text by default, or slotted document blocks.",
|
|
341
|
+
"attribute": "content"
|
|
265
342
|
}
|
|
266
343
|
],
|
|
267
344
|
"attributes": [
|
|
345
|
+
{
|
|
346
|
+
"name": "content",
|
|
347
|
+
"type": {
|
|
348
|
+
"text": "\"markdown\" | \"blocks\""
|
|
349
|
+
},
|
|
350
|
+
"default": "\"markdown\"",
|
|
351
|
+
"description": "Body input: Markdown text by default, or slotted document blocks.",
|
|
352
|
+
"fieldName": "content"
|
|
353
|
+
},
|
|
268
354
|
{
|
|
269
355
|
"name": "open",
|
|
270
356
|
"type": {
|