@offorte/show-doc 0.0.1
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/LICENSE +21 -0
- package/README.md +118 -0
- package/custom-elements.json +1025 -0
- package/dist/THIRD_PARTY_LICENSES.md +2152 -0
- package/dist/showdoc-mermaid.js +143077 -0
- package/dist/showdoc.js +5153 -0
- package/dist/types/components/shw-badge.d.ts +25 -0
- package/dist/types/components/shw-callout.d.ts +31 -0
- package/dist/types/components/shw-card.d.ts +37 -0
- package/dist/types/components/shw-code.d.ts +28 -0
- package/dist/types/components/shw-collapsible.d.ts +30 -0
- package/dist/types/components/shw-doc.d.ts +16 -0
- package/dist/types/components/shw-figure.d.ts +23 -0
- package/dist/types/components/shw-grid.d.ts +24 -0
- package/dist/types/components/shw-header.d.ts +29 -0
- package/dist/types/components/shw-markdown.d.ts +16 -0
- package/dist/types/components/shw-mermaid.d.ts +26 -0
- package/dist/types/components/shw-section.d.ts +34 -0
- package/dist/types/components/shw-stat.d.ts +39 -0
- package/dist/types/components/shw-steps.d.ts +17 -0
- package/dist/types/components/shw-summary.d.ts +24 -0
- package/dist/types/components/shw-table.d.ts +23 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/mermaid.d.ts +2 -0
- package/dist/types/shw-tone.d.ts +1 -0
- package/package.json +106 -0
- package/skills/show-doc/SKILL.md +130 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: show-doc
|
|
3
|
+
description: Create compact, readable standalone HTML documents with versioned Offorte ShowDoc components and Markdown when a human-facing artifact needs more visual structure than normal prose.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "0.0.1" # x-release-please-version
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# ShowDoc
|
|
9
|
+
|
|
10
|
+
Use ShowDoc when the user asks for a ShowDoc or HTML document. Otherwise, use it for reports, plans,
|
|
11
|
+
reviews, decisions, and explanations that need a durable file or more visual structure than normal
|
|
12
|
+
chat Markdown. Do not use it for dashboards, forms, or application-like tools.
|
|
13
|
+
|
|
14
|
+
## Output contract
|
|
15
|
+
|
|
16
|
+
Create one HTML file. Use this skill's exact `metadata.version` in the CDN URL. Use the complete
|
|
17
|
+
starting point below when the document does not need Mermaid:
|
|
18
|
+
|
|
19
|
+
<!-- x-release-please-start-version -->
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<!doctype html>
|
|
23
|
+
<html lang="en">
|
|
24
|
+
<head>
|
|
25
|
+
<meta charset="UTF-8" />
|
|
26
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
27
|
+
<script
|
|
28
|
+
type="module"
|
|
29
|
+
src="https://cdn.jsdelivr.net/npm/@offorte/show-doc@0.0.1/dist/showdoc.js"
|
|
30
|
+
></script>
|
|
31
|
+
<title>Release decision</title>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<shw-doc>
|
|
35
|
+
<shw-header heading="Release decision" eyebrow="Review">
|
|
36
|
+
The current build passed all required checks.
|
|
37
|
+
</shw-header>
|
|
38
|
+
|
|
39
|
+
<shw-summary>The release is **approved**. Complete these two steps.</shw-summary>
|
|
40
|
+
|
|
41
|
+
<shw-section heading="Next steps">
|
|
42
|
+
<shw-steps> 1. Publish the package. 2. Confirm the production version. </shw-steps>
|
|
43
|
+
</shw-section>
|
|
44
|
+
</shw-doc>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If the document uses Mermaid, replace the script in the starting point with the larger bundle:
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<script
|
|
53
|
+
type="module"
|
|
54
|
+
src="https://cdn.jsdelivr.net/npm/@offorte/show-doc@0.0.1/dist/showdoc-mermaid.js"
|
|
55
|
+
></script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
<!-- x-release-please-end -->
|
|
59
|
+
|
|
60
|
+
Use only one script. The Mermaid bundle contains all core components.
|
|
61
|
+
|
|
62
|
+
Use normal document metadata. Wrap the visible document in one `shw-doc`. Do not add inline
|
|
63
|
+
JavaScript, a stylesheet link, copied component DOM, custom presentation CSS, or long runs of
|
|
64
|
+
presentation HTML.
|
|
65
|
+
|
|
66
|
+
After writing the file, open or preview it with the host's supported local-file tool when one is
|
|
67
|
+
available. Return the exact file path.
|
|
68
|
+
|
|
69
|
+
## Component chooser
|
|
70
|
+
|
|
71
|
+
| Element | Compact API | Use |
|
|
72
|
+
| ----------------- | ------------------------------------ | ------------------------------------------------ |
|
|
73
|
+
| `shw-doc` | - | The one page canvas. |
|
|
74
|
+
| `shw-header` | `heading`, `eyebrow?` | The one title and short Markdown lead. |
|
|
75
|
+
| `shw-summary` | `heading?` | The answer before the evidence. |
|
|
76
|
+
| `shw-section` | `heading?`, `intro?`, `level?` | A topic with an automatic divider. |
|
|
77
|
+
| `shw-markdown` | - | Normal prose, lists, links, tasks, and headings. |
|
|
78
|
+
| `shw-mermaid` | `label?` | A diagram from Mermaid source. |
|
|
79
|
+
| `shw-grid` | `columns?` | Two to four sibling blocks to compare. |
|
|
80
|
+
| `shw-card` | `heading?`, `label?`, `tone?` | One grouped idea, choice, or status. |
|
|
81
|
+
| `shw-badge` | `tone?` | A short standalone state or category. |
|
|
82
|
+
| `shw-callout` | `heading?`, `tone?` | One message that needs attention. |
|
|
83
|
+
| `shw-stat` | `label`, `value`, `change?`, `tone?` | One prominent metric or result. |
|
|
84
|
+
| `shw-steps` | - | A process from numbered Markdown lines. |
|
|
85
|
+
| `shw-code` | `filename?`, `language?` | Highlighted HTML, JS, TS, or JSON. |
|
|
86
|
+
| `shw-table` | `caption?` | Row and column data from pipe text. |
|
|
87
|
+
| `shw-figure` | `caption?` | An image, inline SVG, or diagram. |
|
|
88
|
+
| `shw-collapsible` | `summary?`, `open?` | Evidence or detail most readers can skip. |
|
|
89
|
+
|
|
90
|
+
Defaults reduce source. A summary heading is `Summary`. A section level is `2`. Grid columns are
|
|
91
|
+
`2`. A collapsible summary is `Details`. Default tone is `neutral`, except callouts use `info`.
|
|
92
|
+
|
|
93
|
+
Tones are `info`, `success`, `warning`, `danger`, and `neutral`. Use them only when the meaning helps
|
|
94
|
+
the reader.
|
|
95
|
+
|
|
96
|
+
## Choose the smallest useful shape
|
|
97
|
+
|
|
98
|
+
- Pick the smallest structure that makes the main point clear.
|
|
99
|
+
- Start with `shw-header`. Add `shw-summary` when readers need the answer first.
|
|
100
|
+
- Use Markdown for the story. Add a component only when it gives meaning or layout.
|
|
101
|
+
- Use `shw-steps` for a simple sequence. Write each step as `1. ...`, `2. ...`, and so on.
|
|
102
|
+
- Use `shw-code` without `language` for pseudocode, call trees, component trees, file trees, and
|
|
103
|
+
structural diffs. Set `language` only for highlighted HTML, JS, TS, or JSON source.
|
|
104
|
+
- Use `shw-mermaid` when relationships, branches, data flow, or participant interactions matter.
|
|
105
|
+
- Put two or three comparable cards or stats in `shw-grid`.
|
|
106
|
+
- Use a table only for aligned data. Table body cells support Markdown.
|
|
107
|
+
- Use `shw-figure` when one visual needs a caption. Give visuals useful alternative text or labels.
|
|
108
|
+
- Put long logs, assumptions, and rejected options in a collapsible.
|
|
109
|
+
|
|
110
|
+
Use more than one visual form only when each one answers a different question. Do not turn every
|
|
111
|
+
paragraph into a card. Do not use a callout as decoration.
|
|
112
|
+
|
|
113
|
+
## Source rules
|
|
114
|
+
|
|
115
|
+
Keep the HTML shallow. Markdown-rendering components read their text content. Do not nest a
|
|
116
|
+
component inside their Markdown.
|
|
117
|
+
|
|
118
|
+
Blank lines create paragraphs. Task lists use `- [ ]` and `- [x]`. Strikethrough uses `~~text~~`.
|
|
119
|
+
Start optional Markdown headings at `##`. `shw-header` already creates the single `h1`.
|
|
120
|
+
|
|
121
|
+
For `shw-table`, write one pipe-separated row per line. The first row contains headers. Escape a
|
|
122
|
+
content pipe as `\|`.
|
|
123
|
+
|
|
124
|
+
Raw HTML inside Markdown is disabled. Write `<` for a literal `<`, including code inside
|
|
125
|
+
`shw-code`. Use normal `https` links. Do not use `javascript:` or data URLs.
|
|
126
|
+
|
|
127
|
+
Write Mermaid diagram text directly inside `shw-mermaid`. Set `label` to its short accessible name.
|
|
128
|
+
The Mermaid bundle supports the full Mermaid package and makes no extra runtime request.
|
|
129
|
+
|
|
130
|
+
Do not run a generic HTML formatter over the result. It can remove meaningful Markdown line breaks.
|