2.1 KiB
2.1 KiB
Component datasheets
Hand-authored Markdown shown in the Component Picker's hover panel
(ComponentInfoPanel). One file per component:
component-docs/<category>/<id>.md
Full authoring guide (with a per-component id checklist): docs/wiki/component-datasheets.md
<id>MUST match the component id inpublic/components-metadata.json(the loader incomponentDocs.tsmatches by filename and ignores the category folder, so the folder is purely for tidiness).<category>— pick the closestComponentCategory(sensors,displays,input,output,motors,passive,logic,analog,electromech,boards,other).- Keep it scannable. The panel is a hover popover — a good doc is a one-line overview, a pinout table, a few spec bullets, and one wiring tip. The panel is scrollable, so longer datasheets are fine; front-load the essentials.
- GitHub-flavoured Markdown is supported (tables, lists,
`code`, bold, links). Raw HTML is not rendered (react-markdown default).
Front-matter (optional)
A doc may start with a small ----delimited block giving the component's
brand and a purchase link. Both are optional; when present the panel shows a
"by " line under the title and a Buy button in the footer.
---
brand: Aosong (AM2302)
buy: https://www.example.com/product/dht22
---
Body markdown starts here…
brand— manufacturer / brand name (plain text).buy— purchase URL. Must behttp(s)://(other schemes are ignored for safety). The seeded docs use vendor search URLs as placeholders — swap them for the real product or affiliate link.
The panel already lists the live default Properties from metadata below your doc, so don't repeat property defaults here — focus on what the JSON can't express: how the part works, its pinout, wiring, and gotchas.
Adding a doc
- Create
component-docs/<category>/<id>.md. - Write the overview + pinout + tips.
- That's it — the file is picked up automatically (Vite
import.meta.glob), loaded on first hover and cached. No registration needed.