← Commit history

Registry README: what belongs here (generic widgets only; one project's tool is custom HTML on its own page), and inline rendering

Colby Knox ·f8be708969 ·6h ago ·parent 3a0fa2a
1 file changed +16−5
README.md+16−5
@@ -10,7 +10,7 @@ On its own line in any `README.md`: ::adom-pinout{src="/ray/stm32f103c8t6/render/pinout.json" layout="dual"} ``` -It renders in place as a sandboxed frame: opaque origin, storage shimmed, `connect-src` limited to the wiki (plus a backend widget's registered origin). An unregistered tag renders as nothing for readers; pushing a README with one gets a `WIDGET_TAG_UNREGISTERED` hint.+An entry marked `"render": "inline"` (every current widget) renders in place as its custom element, with the reader's session. Any other entry renders as a sandboxed frame: opaque origin, storage shimmed, `connect-src` limited to the wiki (plus a backend widget's registered origin). An unregistered tag renders as nothing for readers; pushing a README with one gets a `WIDGET_TAG_UNREGISTERED` hint.  Data files: pass `src` as an absolute path on the wiki, usually your own page's render route (`/OWNER/SLUG/render/FILE.json`). Relative paths resolve against the widget frame's route and will not find your file. @@ -23,6 +23,17 @@ page's visibility does not matter, and the raw URL 404ing for anonymous callers is expected: in this file it is the repo pointer the route resolves, not the URL readers fetch. +## What belongs here (read before proposing a widget)++The registry is for **generic** widgets: one script that many pages reuse, each page passing its own data through attributes or a `src` file. A pinout, a table, a stock line and a video player all qualify: none of them knows which page it is on.++A tool built for **one project** does not belong here, however polished. Examples are an explorer for one board's circuit, a simulator of one design, or a calculator for one part: its data lives in the script, and only its own page can use it. Put it on that project's page as custom HTML instead:++- **A section next to the README** (keeps README.md): put an HTML file in the page repo with its JS and CSS inlined, then declare it in page.json, for example `"section_sources": {"explorer": "explorer/index.html"}`, and add `"explorer"` to `sections` where it should appear. It renders as its own sandboxed block in the main column.+- **The whole page body:** a `readme.html` (it replaces README.md on the page).++Both are covered by the `wiki-readme-html` skill in adom/adom-wiki-skillpack. A test for a proposed entry: could two unrelated pages each use it with their own data? If not, it is custom HTML, not a widget.+ ## Registering a widget  Append an entry to `widgets.json`:@@ -54,10 +65,10 @@ Five load from adom/component-widgets and take a JSON `src`; adom-stock and adom | `::adom-molecule{src="..."}` | molecule viewer | | `::adom-heatsink-via{src="..."}` | thermal via layout | | `::adom-symbol-variants{src="..."}` | alternate schematic-symbol layouts (2-column, square, grouped, chip outline), generated in the browser |-| `::adom-footprint-variants{src="..."}` | footprint-variant family (baseline, heatsink vias, 300 µm solder balls, rounded pads), parsed live from the page's `.kicad_mod` files; takes an adom-footprint `variants.json` `src` — loads from adom/component-widgets |-| `::adom-table{src="..."}` | any JSON array as a filterable, sortable table — generic, not component-specific; `columns` `heading` `filter` `facet` `sort` `dim` `mark` `colorby` |+| `::adom-footprint-variants{src="..."}` | footprint-variant family (baseline, heatsink vias, 300 µm solder balls, rounded pads), parsed live from the page's `.kicad_mod` files; takes an adom-footprint `variants.json` `src`; loads from adom/component-widgets |+| `::adom-table{src="..."}` | any JSON array as a filterable, sortable table; generic, not component-specific; `columns` `heading` `filter` `facet` `sort` `dim` `mark` `colorby` | | `::adom-stock{src="/api/pages/OWNER/SLUG/stock"}` | live stock and price at Mouser, DigiKey and LCSC for a hardware page, from the wiki's cached vendor lookups (adom/wiki#186); component pages show it in their sidebar by themselves; `heading` |-| `::adom-verified{src="..."}` | the "verified by" trust mark: big green check, who verified the page and when, per-variant coverage, and the full verification log with evidence; turns amber when a verified file changes; takes the page's `verification.json` — loads from adom/component-widgets |-| `::adom-models{src="..."}` | every 3D file on a component page as a card: thumbnail, STEP or GLB, etched or unmarked and where the part number sits, what makes it different from its siblings, what it was derived from, a download, and whether the page still serves the file that was described (checked against the file listing, nothing downloaded); previous versions fold away; takes the page's `models.json` (adom/models@1) — loads from adom/component-widgets |+| `::adom-verified{src="..."}` | the "verified by" trust mark: big green check, who verified the page and when, per-variant coverage, and the full verification log with evidence; turns amber when a verified file changes; takes the page's `verification.json`; loads from adom/component-widgets |+| `::adom-models{src="..."}` | every 3D file on a component page as a card: thumbnail, STEP or GLB, etched or unmarked and where the part number sits, what makes it different from its siblings, what it was derived from, a download, and whether the page still serves the file that was described (checked against the file listing, nothing downloaded); previous versions fold away; takes the page's `models.json` (adom/models@1); loads from adom/component-widgets | | `::adom-video{video="..."}` | a YouTube-style video player: every YouTube shortcut (Space/K, J/L, arrows, 0 to 9, `,` `.` frame step at the video's real frame rate with a frame-number overlay, `<` `>` speed 0.25x to 4x, hold the mouse on the video for 2x, C captions, + / - size, O / W caption opacity, Ctrl+arrows chapters, F, I, M, Shift+N/P, media keys, ?), Clean frame (H: hides the title, controls and captions for a screenshot; the mouse does not bring them back), Copy / Save this frame as a full-resolution PNG, a Share button (copies a link to the page that opens on this video, optionally at the current time: `#video=<file-name>&t=90`, plus the file's own link), a 24px timeline grab zone with drag-to-scrub and a hover frame preview, chapters as bar segments, captions, speed and loop; `title` `poster` `chapters` (JSON `[{"t":12,"title":"..."}]` or WebVTT) `captions` (.vtt or .srt) `start` (`90` or `1m30s`) `loop` `muted` `autoplay`; F opens the player full-window in a new tab (widget frames cannot go fullscreen); a narrated video gets captions and chapters free: gang-takes (adom/adom-video-post) writes the `.vtt` from the adom-tts narration text, the `.chapters.json` from its segment labels, and the embed line; on a private page pass `src=` a manifest with them inlined; a private page's VIDEO plays only where the browser sends third-party cookies until adom/wiki#228 (signed media URLs) ships, elsewhere the widget offers Play it in a new tab; loads from this page | | `::adom-3d{src="..."}` | any GLB in the canonical Adom 3D Viewer, click to load (nothing loads until the reader asks; it unloads offscreen and releases the WebGL context); `poster` `heading` `caption`; publish the GLB without Draco, the frame cannot reach the decoder CDN; loads from adom/component-widgets |