breadkit 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/.codespellignore +2 -0
- data/.yamllint +16 -0
- data/README.md +109 -6
- data/data/boards/double_full.yml +18 -0
- data/data/boards/stripboard.yml +9 -0
- data/data/boards/universal.yml +8 -0
- data/data/parts/2n3904.yml +11 -0
- data/data/parts/2n7000_onsemi_to92.yml +10 -0
- data/data/parts/74hc00.yml +22 -0
- data/data/parts/74hc04.yml +22 -0
- data/data/parts/74hc08.yml +22 -0
- data/data/parts/74hc14.yml +22 -0
- data/data/parts/74hc165.yml +24 -0
- data/data/parts/74hc32.yml +22 -0
- data/data/parts/74hc595.yml +24 -0
- data/data/parts/active_buzzer.yml +8 -0
- data/data/parts/ams1117_3v3.yml +12 -0
- data/data/parts/arduino_nano.yml +70 -0
- data/data/parts/arduino_uno.yml +29 -26
- data/data/parts/atmega328p.yml +37 -0
- data/data/parts/attiny85.yml +16 -0
- data/data/parts/battery_box.yml +8 -0
- data/data/parts/cd4017.yml +24 -0
- data/data/parts/ck_bd04.yml +29 -0
- data/data/parts/crystal.yml +7 -0
- data/data/parts/dc_jack_2wire.yml +8 -0
- data/data/parts/diode.yml +1 -0
- data/data/parts/esp32_devkitc_v4_wroom32e.yml +86 -0
- data/data/parts/irlz44n.yml +10 -0
- data/data/parts/l293d.yml +24 -0
- data/data/parts/led.yml +1 -0
- data/data/parts/lm358.yml +16 -0
- data/data/parts/lm393.yml +16 -0
- data/data/parts/ne555.yml +2 -2
- data/data/parts/ntc_thermistor.yml +7 -0
- data/data/parts/photoresistor.yml +8 -0
- data/data/parts/pico.yml +89 -0
- data/data/parts/resistor.yml +1 -0
- data/data/parts/sc56_11ewa.yml +30 -0
- data/data/parts/seeed_xiao_samd21.yml +37 -0
- data/data/parts/shillehtek_mb102_4pin.yml +23 -0
- data/data/parts/slide_switch_spst.yml +8 -0
- data/data/parts/sparkfun_pro_micro_5v.yml +58 -0
- data/data/parts/transistor.yml +0 -1
- data/data/parts/ua7805.yml +10 -0
- data/data/parts/uln2003a.yml +23 -0
- data/data/parts/wp154a4sureqbfzgc.yml +11 -0
- data/docs/CLI.md +108 -0
- data/docs/COMPATIBILITY.md +60 -0
- data/docs/DECLARATIVE.md +138 -0
- data/docs/IR.md +42 -0
- data/docs/JUMPER_KIT.md +45 -0
- data/docs/LOCK.md +75 -0
- data/docs/LSP.md +59 -0
- data/docs/MB102_POWER.md +11 -0
- data/docs/MCP.md +44 -0
- data/docs/RAKE.md +19 -0
- data/docs/dsl.md +197 -6
- data/exe/breadkit-lsp +13 -0
- data/exe/breadkit-mcp +12 -0
- data/lib/breadkit/analysis.rb +174 -50
- data/lib/breadkit/board.rb +152 -4
- data/lib/breadkit/cli.rb +229 -13
- data/lib/breadkit/color.rb +38 -0
- data/lib/breadkit/dc_analysis.rb +261 -0
- data/lib/breadkit/dsl.rb +205 -24
- data/lib/breadkit/exporters.rb +202 -0
- data/lib/breadkit/formatter.rb +52 -0
- data/lib/breadkit/fritzing_export.rb +256 -0
- data/lib/breadkit/ir.rb +154 -22
- data/lib/breadkit/jumper_kit.rb +127 -0
- data/lib/breadkit/lsp_server.rb +248 -0
- data/lib/breadkit/mcp_server.rb +133 -0
- data/lib/breadkit/model.rb +47 -5
- data/lib/breadkit/part_library.rb +156 -3
- data/lib/breadkit/part_lock.rb +107 -0
- data/lib/breadkit/patterns.rb +119 -0
- data/lib/breadkit/rake_task.rb +25 -0
- data/lib/breadkit/resolver.rb +160 -28
- data/lib/breadkit/structured_input.rb +275 -0
- data/lib/breadkit/templates/555.bk.rb +34 -0
- data/lib/breadkit/templates/arduino.bk.rb +17 -0
- data/lib/breadkit/templates/led.bk.rb +21 -0
- data/lib/breadkit/value.rb +42 -3
- data/lib/breadkit/version.rb +1 -1
- data/lib/breadkit/wire_suggestions.rb +106 -0
- data/lib/breadkit.rb +28 -3
- data/package.json +1 -1
- data/schema/board-v1.json +38 -0
- data/schema/ir-v1.json +56 -11
- data/schema/ir-v2.json +173 -0
- data/schema/part-v1.json +52 -4
- data/sig/breadkit.rbs +107 -5
- metadata +119 -14
- data/docs/assets/01_led_button.svg +0 -12
- data/site/assets/01_led_button.svg +0 -14
- data/site/assets/03_arduino_blink.svg +0 -14
- data/site/favicon.svg +0 -7
- data/site/guide/components/index.html +0 -113
- data/site/guide/dsl/index.html +0 -132
- data/site/guide/index.html +0 -163
- data/site/index.html +0 -95
- data/site/styles.css +0 -14
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="theme-color" content="#101719">
|
|
7
|
-
<meta name="description" content="Breadkit component examples and custom module definitions with typed pins.">
|
|
8
|
-
<title>Components and modules | Breadkit</title>
|
|
9
|
-
<link rel="canonical" href="https://breadkit.github.io/breadkit/guide/components/">
|
|
10
|
-
<link rel="icon" href="../../favicon.svg" type="image/svg+xml">
|
|
11
|
-
<link rel="stylesheet" href="../../assets/site.css">
|
|
12
|
-
</head>
|
|
13
|
-
<body class="min-h-dvh bg-ink font-sans text-paper antialiased">
|
|
14
|
-
<a class="sr-only rounded-sm bg-copper px-4 py-3 font-semibold text-ink focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:outline-2 focus:outline-offset-4 focus:outline-paper" href="#main">Skip to content</a>
|
|
15
|
-
<header class="border-b border-line">
|
|
16
|
-
<div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-4 px-5 py-5 sm:px-8 lg:px-10">
|
|
17
|
-
<a class="flex items-center gap-3 rounded-sm text-xl font-semibold focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../../" aria-label="Breadkit home"><img class="size-8" src="../../favicon.svg" alt="" width="32" height="32"><span>breadkit</span></a>
|
|
18
|
-
<nav aria-label="Main navigation" class="flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-muted">
|
|
19
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Guide</a>
|
|
20
|
-
<a class="rounded-sm text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">Components</a>
|
|
21
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../dsl/">Reference</a>
|
|
22
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render</a>
|
|
23
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Lint</a>
|
|
24
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit">GitHub</a>
|
|
25
|
-
</nav>
|
|
26
|
-
</div>
|
|
27
|
-
</header>
|
|
28
|
-
|
|
29
|
-
<div class="mx-auto grid max-w-7xl gap-10 px-5 py-10 sm:px-8 lg:grid-cols-12 lg:px-10">
|
|
30
|
-
<aside class="border-b border-line pb-6 lg:col-span-2 lg:self-start lg:sticky lg:top-8 lg:border-b-0 lg:pb-0" aria-label="Guide chapters">
|
|
31
|
-
<p class="mb-4 text-sm font-semibold">User guide</p>
|
|
32
|
-
<nav aria-label="Guide navigation" class="flex flex-wrap gap-x-5 gap-y-3 text-sm text-muted lg:flex-col lg:gap-3">
|
|
33
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Getting started</a>
|
|
34
|
-
<a class="rounded-sm text-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">Components and modules</a>
|
|
35
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../dsl/">DSL reference</a>
|
|
36
|
-
<span class="hidden border-t border-line pt-4 text-xs text-muted lg:block">Related tools</span>
|
|
37
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render a diagram</a>
|
|
38
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Check a circuit</a>
|
|
39
|
-
</nav>
|
|
40
|
-
</aside>
|
|
41
|
-
|
|
42
|
-
<main id="main" class="min-w-0 lg:col-span-10 xl:col-span-8">
|
|
43
|
-
<p class="text-sm font-medium text-copper">Breadkit / Components</p>
|
|
44
|
-
<h1 class="mt-3 text-balance text-4xl font-semibold leading-tight sm:text-5xl">Components and modules</h1>
|
|
45
|
-
<p class="mt-6 max-w-3xl text-pretty text-lg leading-8 text-muted">Place a component by naming the holes for its leads or its anchor hole. Use <code class="font-mono text-paper">offboard</code> for modules beside the breadboard, then wire their named pins.</p>
|
|
46
|
-
|
|
47
|
-
<section id="parts" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
48
|
-
<h2 class="text-balance text-2xl font-semibold">Common components</h2>
|
|
49
|
-
<p class="mt-4 text-pretty leading-7 text-muted">These built-in definitions support rendering and connection analysis. Hole positions are examples; choose positions that fit your circuit.</p>
|
|
50
|
-
<div class="mt-6 overflow-x-auto rounded-lg border border-line">
|
|
51
|
-
<table class="w-full min-w-2xl border-collapse text-left text-sm">
|
|
52
|
-
<thead class="bg-board"><tr><th class="px-4 py-3 font-semibold">Component</th><th class="px-4 py-3 font-semibold">DSL</th><th class="px-4 py-3 font-semibold">Placement</th></tr></thead>
|
|
53
|
-
<tbody class="text-muted">
|
|
54
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">Resistor</th><td class="px-4 py-4 font-mono text-paper">resistor :R1, "330", pins: %w[a12 a16]</td><td class="px-4 py-4">Two leads</td></tr>
|
|
55
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">LED</th><td class="px-4 py-4 font-mono text-paper">led :D1, color: :red, anode: "b16", cathode: "b17"</td><td class="px-4 py-4">Two polarized leads</td></tr>
|
|
56
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">Push button</th><td class="px-4 py-4 font-mono text-paper">button :SW1, at: "e10"</td><td class="px-4 py-4">Across the center gap</td></tr>
|
|
57
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">Capacitor</th><td class="px-4 py-4 font-mono text-paper">capacitor :C1, "10n", pins: %w[h23 h24]</td><td class="px-4 py-4">Two nonpolarized leads</td></tr>
|
|
58
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">Electrolytic capacitor</th><td class="px-4 py-4 font-mono text-paper">electrolytic :C2, "100u", plus: "g22", minus: "j24"</td><td class="px-4 py-4">Positive and negative leads</td></tr>
|
|
59
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-semibold text-paper">NE555</th><td class="px-4 py-4 font-mono text-paper">ic :U1, "NE555", at: "e20"</td><td class="px-4 py-4">Anchor at pin 1</td></tr>
|
|
60
|
-
</tbody>
|
|
61
|
-
</table>
|
|
62
|
-
</div>
|
|
63
|
-
<p class="mt-5 text-pretty leading-7 text-muted">Built-in definitions also include diodes, transistors, and potentiometers. BC547 and BC557 use CBE pin order; 2N3904 and 2N3906 use EBC. An unknown transistor model emits a warning and uses the generic EBC order. Run <code class="font-mono text-paper">breadkit parts</code> to list definitions. Values may use units such as <code class="font-mono text-paper">4.7k</code> or <code class="font-mono text-paper">10uF</code>.</p>
|
|
64
|
-
</section>
|
|
65
|
-
|
|
66
|
-
<section id="modules" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
67
|
-
<h2 class="text-balance text-2xl font-semibold">Define module pins</h2>
|
|
68
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Define offboard modules such as OLEDs and sensors in YAML. This excerpt from the SHT31 definition names each pin and its <code class="font-mono text-paper">type:</code>, which controls the pin marker color.</p>
|
|
69
|
-
<div class="mt-6 grid min-w-0 gap-5 xl:grid-cols-2">
|
|
70
|
-
<div class="min-w-0 rounded-lg border border-line bg-board"><div class="border-b border-line px-4 py-3 text-sm text-muted">parts/sht31.yml</div><pre class="overflow-x-auto p-4 font-mono text-xs leading-6 sm:text-sm"><code>id: sht31
|
|
71
|
-
category: module
|
|
72
|
-
placement: offboard
|
|
73
|
-
pins:
|
|
74
|
-
- {num: 1, name: VIN, type: power}
|
|
75
|
-
- {num: 2, name: GND, type: ground}
|
|
76
|
-
- {num: 3, name: SCL, type: clock}
|
|
77
|
-
- {num: 4, name: SDA, type: data}
|
|
78
|
-
- {num: 5, name: ADR, type: address}
|
|
79
|
-
- {num: 6, name: ALR, type: interrupt}
|
|
80
|
-
render: {shape: offboard, label: SHT31}</code></pre></div>
|
|
81
|
-
<div class="min-w-0 rounded-lg border border-line bg-board"><div class="border-b border-line px-4 py-3 text-sm text-muted">Use it in a circuit file</div><pre class="overflow-x-auto p-4 font-mono text-xs leading-6 sm:text-sm"><code>board :full
|
|
82
|
-
use_parts "parts/*.yml"
|
|
83
|
-
offboard :SHT31, :sht31, side: :right,
|
|
84
|
-
at: "a12", address: "0x44"
|
|
85
|
-
|
|
86
|
-
wire "SHT31.SCL", "h22", color: :yellow
|
|
87
|
-
wire "SHT31.SDA", "h24", color: :blue</code></pre><p class="px-4 pb-5 text-pretty text-sm leading-6 text-muted">The module appears beside the board. Wire SCL and SDA by name, and connect the real power pins too.</p></div>
|
|
88
|
-
</div>
|
|
89
|
-
<p class="mt-5 text-pretty leading-7 text-muted">For a board-mounted module such as an RP2040, define <code class="font-mono text-paper">placement: footprint</code> and its pin positions, then place it with <code class="font-mono text-paper">part :PICO, :rp2040_clone, at: "c1"</code>. <a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit/tree/main/examples/parts">Browse the part definitions</a>.</p>
|
|
90
|
-
</section>
|
|
91
|
-
|
|
92
|
-
<section id="sensor-demo" class="scroll-mt-8 border-t border-line pt-10 mt-12 pb-16">
|
|
93
|
-
<h2 class="text-balance text-2xl font-semibold">A circuit with several modules</h2>
|
|
94
|
-
<p class="mt-4 text-pretty leading-7 text-muted">The sensor demo places an RP2040-compatible board on the breadboard and an OLED plus two SHT31 modules beside it. Power, I2C, switches, and IR wiring can be shown layer by layer.</p>
|
|
95
|
-
<figure class="mt-6 overflow-hidden rounded-lg border border-line bg-board">
|
|
96
|
-
<div class="flex justify-center p-5 sm:p-8"><img class="h-auto w-full max-w-lg" src="https://breadkit.github.io/breadkit-render/images/sensor-demo.png" alt="Diagram with an RP2040, OLED, two SHT31 modules, switches, and IR sensor modules" width="848" height="1311" loading="lazy"></div>
|
|
97
|
-
<figcaption class="flex flex-wrap gap-x-5 gap-y-2 border-t border-line px-5 py-4 text-sm text-muted"><a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/images/sensor-demo.svg">Open layered SVG</a><a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit/blob/main/examples/05_sensor_demo.bk.rb">View circuit source</a></figcaption>
|
|
98
|
-
</figure>
|
|
99
|
-
</section>
|
|
100
|
-
</main>
|
|
101
|
-
|
|
102
|
-
<nav class="hidden xl:col-span-2 xl:block xl:self-start xl:sticky xl:top-8" aria-label="On this page">
|
|
103
|
-
<p class="mb-4 text-sm font-semibold">On this page</p>
|
|
104
|
-
<ul class="space-y-3 border-l border-line pl-4 text-sm text-muted">
|
|
105
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#parts">Common components</a></li>
|
|
106
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#modules">Module definitions</a></li>
|
|
107
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#sensor-demo">Multi-module example</a></li>
|
|
108
|
-
</ul>
|
|
109
|
-
</nav>
|
|
110
|
-
</div>
|
|
111
|
-
<footer class="border-t border-line"><div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-3 px-5 py-7 text-sm text-muted sm:px-8 lg:px-10"><p>See component connections in both the diagram and the circuit data.</p><a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Back to the guide</a></div></footer>
|
|
112
|
-
</body>
|
|
113
|
-
</html>
|
data/site/guide/dsl/index.html
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="theme-color" content="#101719">
|
|
7
|
-
<meta name="description" content="Breadkit DSL reference: declarations, component placement, hole and pin references, layers, switch states, and CLI commands.">
|
|
8
|
-
<title>DSL reference | Breadkit</title>
|
|
9
|
-
<link rel="canonical" href="https://breadkit.github.io/breadkit/guide/dsl/">
|
|
10
|
-
<link rel="icon" href="../../favicon.svg" type="image/svg+xml">
|
|
11
|
-
<link rel="stylesheet" href="../../assets/site.css">
|
|
12
|
-
</head>
|
|
13
|
-
<body class="min-h-dvh bg-ink font-sans text-paper antialiased">
|
|
14
|
-
<a class="sr-only rounded-sm bg-copper px-4 py-3 font-semibold text-ink focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:outline-2 focus:outline-offset-4 focus:outline-paper" href="#main">Skip to content</a>
|
|
15
|
-
<header class="border-b border-line">
|
|
16
|
-
<div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-4 px-5 py-5 sm:px-8 lg:px-10">
|
|
17
|
-
<a class="flex items-center gap-3 rounded-sm text-xl font-semibold focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../../" aria-label="Breadkit home"><img class="size-8" src="../../favicon.svg" alt="" width="32" height="32"><span>breadkit</span></a>
|
|
18
|
-
<nav aria-label="Main navigation" class="flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-muted">
|
|
19
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Guide</a>
|
|
20
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../components/">Components</a>
|
|
21
|
-
<a class="rounded-sm text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">Reference</a>
|
|
22
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render</a>
|
|
23
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Lint</a>
|
|
24
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit">GitHub</a>
|
|
25
|
-
</nav>
|
|
26
|
-
</div>
|
|
27
|
-
</header>
|
|
28
|
-
|
|
29
|
-
<div class="mx-auto grid max-w-7xl gap-10 px-5 py-10 sm:px-8 lg:grid-cols-12 lg:px-10">
|
|
30
|
-
<aside class="border-b border-line pb-6 lg:col-span-2 lg:self-start lg:sticky lg:top-8 lg:border-b-0 lg:pb-0" aria-label="Guide chapters">
|
|
31
|
-
<p class="mb-4 text-sm font-semibold">User guide</p>
|
|
32
|
-
<nav aria-label="Guide navigation" class="flex flex-wrap gap-x-5 gap-y-3 text-sm text-muted lg:flex-col lg:gap-3">
|
|
33
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Getting started</a>
|
|
34
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../components/">Components and modules</a>
|
|
35
|
-
<a class="rounded-sm text-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">DSL reference</a>
|
|
36
|
-
<span class="hidden border-t border-line pt-4 text-xs text-muted lg:block">Related tools</span>
|
|
37
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render a diagram</a>
|
|
38
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Check a circuit</a>
|
|
39
|
-
</nav>
|
|
40
|
-
</aside>
|
|
41
|
-
|
|
42
|
-
<main id="main" class="min-w-0 lg:col-span-10 xl:col-span-8">
|
|
43
|
-
<p class="text-sm font-medium text-copper">Breadkit / Reference</p>
|
|
44
|
-
<h1 class="mt-3 text-balance text-4xl font-semibold leading-tight sm:text-5xl">DSL reference</h1>
|
|
45
|
-
<p class="mt-6 max-w-3xl text-pretty text-lg leading-8 text-muted">A <code class="font-mono text-paper">.bk.rb</code> file describes the board, parts, wires, and expected connections. Breadkit resolves it into nets and JSON IR. The file runs as Ruby, so only load files you trust.</p>
|
|
46
|
-
|
|
47
|
-
<section id="example" class="scroll-mt-8 mt-12 border-t border-line pt-10">
|
|
48
|
-
<h2 class="text-balance text-2xl font-semibold">A small circuit</h2>
|
|
49
|
-
<p class="mt-4 text-pretty leading-7 text-muted">This is the button and LED example used in the <a class="text-paper underline decoration-copper underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../#led-example">guide</a>.</p>
|
|
50
|
-
<pre class="mt-5 overflow-x-auto rounded-lg border border-line bg-board p-5 font-mono text-sm leading-6"><code>title "Button-controlled LED"
|
|
51
|
-
board :half
|
|
52
|
-
supply :USB, voltage: 5.0, plus: "B+1", minus: "B-1"
|
|
53
|
-
net :VCC, at: "B+1"
|
|
54
|
-
net :GND, at: "B-1"
|
|
55
|
-
|
|
56
|
-
button :SW1, at: "e10"
|
|
57
|
-
resistor :R1, "330", pins: %w[a12 a16]
|
|
58
|
-
led :D1, color: :red, anode: "b16", cathode: "b17"
|
|
59
|
-
wire "a10", "B+", color: :red
|
|
60
|
-
wire "a17", "B-", color: :black
|
|
61
|
-
|
|
62
|
-
expect do
|
|
63
|
-
connected "SW1.1", :VCC
|
|
64
|
-
isolated :VCC, :GND
|
|
65
|
-
end</code></pre>
|
|
66
|
-
</section>
|
|
67
|
-
|
|
68
|
-
<section id="declarations" class="scroll-mt-8 mt-12 border-t border-line pt-10">
|
|
69
|
-
<h2 class="text-balance text-2xl font-semibold">Declarations</h2>
|
|
70
|
-
<div class="mt-6 overflow-x-auto rounded-lg border border-line">
|
|
71
|
-
<table class="w-full min-w-2xl border-collapse text-left text-sm">
|
|
72
|
-
<thead class="bg-board"><tr><th class="px-4 py-3 font-semibold">Method</th><th class="px-4 py-3 font-semibold">Purpose</th></tr></thead>
|
|
73
|
-
<tbody class="text-muted">
|
|
74
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">title(text)</th><td class="px-4 py-4">Set the diagram title.</td></tr>
|
|
75
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">board(id, split_rails: false)</th><td class="px-4 py-4">Select <code>:full</code>, <code>:half</code>, <code>:mini</code>, or a custom board ID.</td></tr>
|
|
76
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">use_parts(path) / use_boards(path)</th><td class="px-4 py-4">Load YAML definitions relative to the DSL file. Globs are supported.</td></tr>
|
|
77
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">supply(name, voltage:, plus:, minus:)</th><td class="px-4 py-4">Add a DC source. Both terminals occupy board holes.</td></tr>
|
|
78
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">net(name, at:)</th><td class="px-4 py-4">Label a hole or component pin.</td></tr>
|
|
79
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">part(ref, type, value = nil, pins: ..., at: ..., **attrs)</th><td class="px-4 py-4">Place a defined part. <code>pins:</code> accepts an ordered array or a pin-name hash.</td></tr>
|
|
80
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">wire(from, to, color: nil, route: :straight, layer: nil)</th><td class="px-4 py-4">Connect holes or pins. Use <code>route: :arc</code> for a curve or <code>route: :edge</code> around the board edge. Options also include <code>id:</code>, <code>electrical:</code>, and <code>dashed:</code>.</td></tr>
|
|
81
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">offboard(name, type, side: :left, at: nil, unused: [])</th><td class="px-4 py-4">Place a module beside the board. <code>at:</code> aligns its first pin; extra attributes such as <code>address:</code> appear on the module.</td></tr>
|
|
82
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">expect(strict: false) { ... }</th><td class="px-4 py-4">Declare <code>connected</code>, <code>isolated</code>, or named <code>net</code> expectations. Strict mode also rejects unlisted pins on declared nets.</td></tr>
|
|
83
|
-
<tr class="border-t border-line"><th class="px-4 py-4 font-mono font-normal text-paper">lint_disable(rule, on: nil, reason: nil)</th><td class="px-4 py-4">Suppress a lint rule, optionally for one target.</td></tr>
|
|
84
|
-
</tbody>
|
|
85
|
-
</table>
|
|
86
|
-
</div>
|
|
87
|
-
<p class="mt-5 text-pretty leading-7 text-muted">Short forms are available for <code class="font-mono text-paper">resistor</code>, <code class="font-mono text-paper">capacitor</code>, <code class="font-mono text-paper">electrolytic</code>, <code class="font-mono text-paper">diode</code>, <code class="font-mono text-paper">led</code>, <code class="font-mono text-paper">transistor</code>, <code class="font-mono text-paper">pot</code>, <code class="font-mono text-paper">button</code>, and <code class="font-mono text-paper">ic</code>. See the <a class="text-paper underline decoration-copper underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../components/">component examples</a>.</p>
|
|
88
|
-
</section>
|
|
89
|
-
|
|
90
|
-
<section id="references" class="scroll-mt-8 mt-12 border-t border-line pt-10">
|
|
91
|
-
<h2 class="text-balance text-2xl font-semibold">Hole and pin references</h2>
|
|
92
|
-
<ul class="mt-5 list-disc space-y-3 pl-6 text-pretty leading-7 text-muted">
|
|
93
|
-
<li>Terminal holes use rows <code class="font-mono text-paper">a</code> through <code class="font-mono text-paper">j</code> and 1-based numbers, such as <code class="font-mono text-paper">a10</code> or <code class="font-mono text-paper">J30</code>.</li>
|
|
94
|
-
<li>Rail holes use <code class="font-mono text-paper">T+</code>, <code class="font-mono text-paper">T-</code>, <code class="font-mono text-paper">B+</code>, and <code class="font-mono text-paper">B-</code>, with an optional 1-based index. A rail without an index selects a free hole.</li>
|
|
95
|
-
<li>Custom board YAML may define other row and rail IDs. Rows <code class="font-mono text-paper">u</code> and <code class="font-mono text-paper">v</code> use <code class="font-mono text-paper">u1</code> and <code class="font-mono text-paper">v1</code>; a rail with <code class="font-mono text-paper">id: PWR</code> uses <code class="font-mono text-paper">PWR1</code> or <code class="font-mono text-paper">PWR</code>. Set rail <code class="font-mono text-paper">polarity:</code> to <code class="font-mono text-paper">+</code> or <code class="font-mono text-paper">-</code> for polarity-aware rendering.</li>
|
|
96
|
-
<li>Component pins use names such as <code class="font-mono text-paper">R1.1</code>, <code class="font-mono text-paper">D1.anode</code>, or <code class="font-mono text-paper">U1.VCC</code>. A wire endpoint referencing a placed pin selects a free hole on its conductive strip.</li>
|
|
97
|
-
<li><code class="font-mono text-paper">ne555</code> and generic <code class="font-mono text-paper">dip</code> parts must straddle the center gap. For a generic DIP, set <code class="font-mono text-paper">pin_count</code>, such as <code class="font-mono text-paper">part :U2, :dip, pin_count: 14, at: "e20"</code>.</li>
|
|
98
|
-
<li>A generic header can be sized with <code class="font-mono text-paper">part :J1, :pin_header, pin_count: 4, pins: %w[a1 a2 a3 a4]</code>.</li>
|
|
99
|
-
</ul>
|
|
100
|
-
<p class="mt-5 text-pretty leading-7 text-muted">Values accept SI suffixes and RKM notation, including <code class="font-mono text-paper">4.7k</code>, <code class="font-mono text-paper">4k7</code>, <code class="font-mono text-paper">1M</code>, <code class="font-mono text-paper">100n</code>, and <code class="font-mono text-paper">10uF</code>.</p>
|
|
101
|
-
</section>
|
|
102
|
-
|
|
103
|
-
<section id="layers" class="scroll-mt-8 mt-12 border-t border-line pt-10">
|
|
104
|
-
<h2 class="text-balance text-2xl font-semibold">Layers and module pins</h2>
|
|
105
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Give wires and components the same <code class="font-mono text-paper">layer:</code> to show them together in an interactive SVG. A layer can be one name or a list of names. Components without a layer remain visible in every view. Use <code class="font-mono text-paper">electrical: false, dashed: true</code> for an alternate visual connection that does not affect connectivity.</p>
|
|
106
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Custom YAML definitions can mark module pins with <code class="font-mono text-paper">type:</code> values such as <code class="font-mono text-paper">power</code>, <code class="font-mono text-paper">ground</code>, <code class="font-mono text-paper">clock</code>, <code class="font-mono text-paper">data</code>, <code class="font-mono text-paper">address</code>, or <code class="font-mono text-paper">interrupt</code>. The renderer colors those markers and dims unwired pins.</p>
|
|
107
|
-
</section>
|
|
108
|
-
|
|
109
|
-
<section id="cli" class="scroll-mt-8 mt-12 border-t border-line pt-10 pb-16">
|
|
110
|
-
<h2 class="text-balance text-2xl font-semibold">Switch states, IR, and CLI</h2>
|
|
111
|
-
<p class="mt-4 text-pretty leading-7 text-muted"><code class="font-mono text-paper">circuit.states("none")</code>, <code class="font-mono text-paper">circuit.states("single")</code>, and <code class="font-mono text-paper">circuit.states("all")</code> control switch contact simulation. <code class="font-mono text-paper">Breadkit.load(path)</code> reads DSL or JSON IR. <code class="font-mono text-paper">circuit.to_ir</code> returns the resolved circuit data, including selected hole positions.</p>
|
|
112
|
-
<pre class="mt-5 overflow-x-auto rounded-lg border border-line bg-board p-5 font-mono text-sm leading-7"><code>breadkit nets circuit.bk.rb
|
|
113
|
-
breadkit parts
|
|
114
|
-
breadkit ir circuit.bk.rb</code></pre>
|
|
115
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Use <code class="font-mono text-paper">breadkit nets</code> to inspect connections, <code class="font-mono text-paper">breadkit parts</code> to list built-in definitions, and <code class="font-mono text-paper">breadkit ir</code> to print JSON IR.</p>
|
|
116
|
-
</section>
|
|
117
|
-
</main>
|
|
118
|
-
|
|
119
|
-
<nav class="hidden xl:col-span-2 xl:block xl:self-start xl:sticky xl:top-8" aria-label="On this page">
|
|
120
|
-
<p class="mb-4 text-sm font-semibold">On this page</p>
|
|
121
|
-
<ul class="space-y-3 border-l border-line pl-4 text-sm text-muted">
|
|
122
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#example">Example</a></li>
|
|
123
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#declarations">Declarations</a></li>
|
|
124
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#references">References</a></li>
|
|
125
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#layers">Layers and pins</a></li>
|
|
126
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#cli">CLI and IR</a></li>
|
|
127
|
-
</ul>
|
|
128
|
-
</nav>
|
|
129
|
-
</div>
|
|
130
|
-
<footer class="border-t border-line"><div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-3 px-5 py-7 text-sm text-muted sm:px-8 lg:px-10"><p>Use the guide for a step-by-step example.</p><a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Back to the guide</a></div></footer>
|
|
131
|
-
</body>
|
|
132
|
-
</html>
|
data/site/guide/index.html
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="theme-color" content="#101719">
|
|
7
|
-
<meta name="description" content="Learn Breadkit by writing a circuit in Ruby and comparing the code with real generated diagrams.">
|
|
8
|
-
<title>User guide | Breadkit</title>
|
|
9
|
-
<link rel="canonical" href="https://breadkit.github.io/breadkit/guide/">
|
|
10
|
-
<link rel="icon" href="../favicon.svg" type="image/svg+xml">
|
|
11
|
-
<link rel="stylesheet" href="../assets/site.css">
|
|
12
|
-
</head>
|
|
13
|
-
<body class="min-h-dvh bg-ink font-sans text-paper antialiased">
|
|
14
|
-
<a class="sr-only rounded-sm bg-copper px-4 py-3 font-semibold text-ink focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:outline-2 focus:outline-offset-4 focus:outline-paper" href="#main">Skip to content</a>
|
|
15
|
-
<header class="border-b border-line">
|
|
16
|
-
<div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-4 px-5 py-5 sm:px-8 lg:px-10">
|
|
17
|
-
<a class="flex items-center gap-3 rounded-sm text-xl font-semibold focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../" aria-label="Breadkit home"><img class="size-8" src="../favicon.svg" alt="" width="32" height="32"><span>breadkit</span></a>
|
|
18
|
-
<nav aria-label="Main navigation" class="flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-muted">
|
|
19
|
-
<a class="rounded-sm text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">Guide</a>
|
|
20
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./components/">Components</a>
|
|
21
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./dsl/">Reference</a>
|
|
22
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render</a>
|
|
23
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Lint</a>
|
|
24
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit">GitHub</a>
|
|
25
|
-
</nav>
|
|
26
|
-
</div>
|
|
27
|
-
</header>
|
|
28
|
-
|
|
29
|
-
<div class="mx-auto grid max-w-7xl gap-10 px-5 py-10 sm:px-8 lg:grid-cols-12 lg:px-10">
|
|
30
|
-
<aside class="border-b border-line pb-6 lg:col-span-2 lg:self-start lg:sticky lg:top-8 lg:border-b-0 lg:pb-0" aria-label="Guide chapters">
|
|
31
|
-
<p class="mb-4 text-sm font-semibold text-paper">User guide</p>
|
|
32
|
-
<nav aria-label="Guide navigation" class="flex flex-wrap gap-x-5 gap-y-3 text-sm text-muted lg:flex-col lg:gap-3">
|
|
33
|
-
<a class="rounded-sm text-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-current="page">Getting started</a>
|
|
34
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./components/">Components and modules</a>
|
|
35
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./dsl/">DSL reference</a>
|
|
36
|
-
<span class="hidden border-t border-line pt-4 text-xs text-muted lg:block">Related tools</span>
|
|
37
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render a diagram</a>
|
|
38
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Check a circuit</a>
|
|
39
|
-
</nav>
|
|
40
|
-
</aside>
|
|
41
|
-
|
|
42
|
-
<main id="main" class="min-w-0 lg:col-span-10 xl:col-span-8">
|
|
43
|
-
<p class="text-sm font-medium text-copper">Breadkit / Guide</p>
|
|
44
|
-
<h1 class="mt-3 text-balance text-4xl font-semibold leading-tight sm:text-5xl">From circuit code to diagram.</h1>
|
|
45
|
-
<p class="mt-6 max-w-3xl text-pretty text-lg leading-8 text-muted">Follow a working example from component placement to SVG output. Each diagram below was generated from the code shown beside it.</p>
|
|
46
|
-
|
|
47
|
-
<section id="setup" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
48
|
-
<h2 class="text-balance text-2xl font-semibold">Set up</h2>
|
|
49
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Install Ruby and the gems you need. Breadkit describes the circuit, breadkit-render draws it, and breadkit-lint checks it.</p>
|
|
50
|
-
<pre class="mt-5 overflow-x-auto rounded-lg border border-line bg-board p-5 font-mono text-sm leading-7"><code>gem install breadkit breadkit-render breadkit-lint</code></pre>
|
|
51
|
-
<p class="mt-4 text-pretty text-sm leading-6 text-muted"><code class="font-mono text-paper">.bk.rb</code> files run as Ruby. Only load files you trust. Use IR JSON when you need to exchange data without executing code.</p>
|
|
52
|
-
</section>
|
|
53
|
-
|
|
54
|
-
<section id="led-example" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
55
|
-
<h2 class="text-balance text-2xl font-semibold">Code and output: button and LED</h2>
|
|
56
|
-
<p class="mt-4 text-pretty leading-7 text-muted"><code class="font-mono text-paper">01_led_button.bk.rb</code> places a switch, resistor, and LED on a half-size board. The code is on the left; the generated diagram is on the right.</p>
|
|
57
|
-
<div class="mt-6 grid min-w-0 gap-5 xl:grid-cols-2">
|
|
58
|
-
<div class="min-w-0 rounded-lg border border-line bg-board">
|
|
59
|
-
<div class="border-b border-line px-4 py-3 text-sm text-muted">01_led_button.bk.rb</div>
|
|
60
|
-
<pre class="overflow-x-auto p-4 font-mono text-xs leading-6 sm:text-sm"><code>title "Button-controlled LED"
|
|
61
|
-
board :half
|
|
62
|
-
|
|
63
|
-
supply :USB, voltage: 5.0, plus: "B+1", minus: "B-1"
|
|
64
|
-
net :VCC, at: "B+1"
|
|
65
|
-
net :GND, at: "B-1"
|
|
66
|
-
|
|
67
|
-
button :SW1, at: "e10"
|
|
68
|
-
resistor :R1, "330", pins: %w[a12 a16]
|
|
69
|
-
led :D1, color: :red, anode: "b16", cathode: "b17"
|
|
70
|
-
|
|
71
|
-
wire "a10", "B+", color: :red
|
|
72
|
-
wire "a17", "B-", color: :black
|
|
73
|
-
|
|
74
|
-
expect do
|
|
75
|
-
connected "SW1.1", :VCC
|
|
76
|
-
connected "SW1.3", "R1.1"
|
|
77
|
-
connected "R1.2", "D1.anode"
|
|
78
|
-
connected "D1.cathode", :GND
|
|
79
|
-
isolated :VCC, :GND
|
|
80
|
-
end</code></pre>
|
|
81
|
-
</div>
|
|
82
|
-
<figure class="m-0 flex min-w-0 flex-col rounded-lg border border-line bg-board">
|
|
83
|
-
<div class="flex flex-1 items-center justify-center p-5">
|
|
84
|
-
<img class="h-auto w-full max-w-sm" src="../assets/01_led_button.svg" alt="Half-size breadboard diagram connecting a switch, resistor, LED, and ground" width="205" height="320">
|
|
85
|
-
</div>
|
|
86
|
-
<figcaption class="border-t border-line px-4 py-3 text-sm text-muted">Generated SVG. <a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../assets/01_led_button.svg">Open full size</a></figcaption>
|
|
87
|
-
</figure>
|
|
88
|
-
</div>
|
|
89
|
-
<p class="mt-5 text-pretty leading-7 text-muted"><code class="font-mono text-paper">at: "e10"</code> places the switch's first pin in hole e10. <code class="font-mono text-paper">pins:</code>, <code class="font-mono text-paper">anode:</code>, and <code class="font-mono text-paper">cathode:</code> name the holes occupied by component leads. <code class="font-mono text-paper">wire</code> joins strips or rails with a jumper.</p>
|
|
90
|
-
<pre class="mt-5 overflow-x-auto rounded-lg border border-line bg-board p-5 font-mono text-sm leading-7"><code>bkrender 01_led_button.bk.rb -o led.svg --theme dark
|
|
91
|
-
bklint 01_led_button.bk.rb
|
|
92
|
-
breadkit nets 01_led_button.bk.rb</code></pre>
|
|
93
|
-
<p class="mt-4 text-pretty text-sm leading-6 text-muted"><code class="font-mono text-paper">expect</code> records the intended connections. bklint compares them with the resolved circuit. <a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit/blob/main/examples/01_led_button.bk.rb">View the original file</a>.</p>
|
|
94
|
-
</section>
|
|
95
|
-
|
|
96
|
-
<section id="holes" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
97
|
-
<h2 class="text-balance text-2xl font-semibold">Holes and power rails</h2>
|
|
98
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Terminal holes use a letter from <code class="font-mono text-paper">a</code> to <code class="font-mono text-paper">j</code> and a number, such as <code class="font-mono text-paper">a10</code>. Rails use <code class="font-mono text-paper">T+</code> / <code class="font-mono text-paper">T-</code> at the top and <code class="font-mono text-paper">B+</code> / <code class="font-mono text-paper">B-</code> at the bottom. <code class="font-mono text-paper">B+1</code> selects a position; <code class="font-mono text-paper">B+</code> chooses a free hole.</p>
|
|
99
|
-
<div class="mt-5 overflow-x-auto rounded-lg border border-line">
|
|
100
|
-
<table class="w-full min-w-lg border-collapse text-left text-sm">
|
|
101
|
-
<thead class="bg-board text-paper"><tr><th class="px-4 py-3 font-semibold">Reference</th><th class="px-4 py-3 font-semibold">Meaning</th></tr></thead>
|
|
102
|
-
<tbody class="text-muted">
|
|
103
|
-
<tr class="border-t border-line"><td class="px-4 py-3 font-mono text-paper">e10</td><td class="px-4 py-3">Hole 10 in column e</td></tr>
|
|
104
|
-
<tr class="border-t border-line"><td class="px-4 py-3 font-mono text-paper">B+1</td><td class="px-4 py-3">First hole on the bottom positive rail</td></tr>
|
|
105
|
-
<tr class="border-t border-line"><td class="px-4 py-3 font-mono text-paper">D1.anode</td><td class="px-4 py-3">The conductive strip containing D1's anode</td></tr>
|
|
106
|
-
</tbody>
|
|
107
|
-
</table>
|
|
108
|
-
</div>
|
|
109
|
-
</section>
|
|
110
|
-
|
|
111
|
-
<section id="module-example" class="scroll-mt-8 border-t border-line pt-10 mt-12">
|
|
112
|
-
<h2 class="text-balance text-2xl font-semibold">Offboard modules</h2>
|
|
113
|
-
<p class="mt-4 text-pretty leading-7 text-muted">Use <code class="font-mono text-paper">offboard</code> to place an Arduino Uno or another module beside the breadboard and connect wires to its named pins. This diagram was generated from the code shown here.</p>
|
|
114
|
-
<div class="mt-6 grid min-w-0 gap-5 xl:grid-cols-2">
|
|
115
|
-
<div class="min-w-0 rounded-lg border border-line bg-board">
|
|
116
|
-
<div class="border-b border-line px-4 py-3 text-sm text-muted">03_arduino_blink.bk.rb</div>
|
|
117
|
-
<pre class="overflow-x-auto p-4 font-mono text-xs leading-6 sm:text-sm"><code>title "Arduino UNO LED"
|
|
118
|
-
board :half
|
|
119
|
-
offboard :UNO, "arduino_uno", side: :left
|
|
120
|
-
|
|
121
|
-
resistor :R1, "330", pins: %w[a10 a14]
|
|
122
|
-
led :D1, color: :red, anode: "b14", cathode: "b16"
|
|
123
|
-
|
|
124
|
-
wire "UNO.D13", "c10", color: :yellow
|
|
125
|
-
wire "a16", "UNO.GND", color: :black
|
|
126
|
-
|
|
127
|
-
expect do
|
|
128
|
-
connected "UNO.D13", "R1.1"
|
|
129
|
-
connected "R1.2", "D1.anode"
|
|
130
|
-
connected "D1.cathode", "UNO.GND"
|
|
131
|
-
end</code></pre>
|
|
132
|
-
</div>
|
|
133
|
-
<figure class="m-0 flex min-w-0 flex-col rounded-lg border border-line bg-board">
|
|
134
|
-
<div class="flex flex-1 items-center justify-center p-5"><img class="h-auto w-full" src="../assets/03_arduino_blink.svg" alt="Generated diagram wiring an offboard Arduino Uno to a breadboard resistor and LED" width="265" height="236"></div>
|
|
135
|
-
<figcaption class="border-t border-line px-4 py-3 text-sm text-muted">Connected to Arduino Uno D13 and GND. <a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../assets/03_arduino_blink.svg">Open full size</a></figcaption>
|
|
136
|
-
</figure>
|
|
137
|
-
</div>
|
|
138
|
-
<p class="mt-5 text-pretty leading-7 text-muted">Custom modules define pin names and <code class="font-mono text-paper">type:</code> values in YAML. Types such as power, ground, clock, and data also control the pin markers in the diagram. <a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./components/#modules">See a module definition</a>.</p>
|
|
139
|
-
</section>
|
|
140
|
-
|
|
141
|
-
<section id="next" class="scroll-mt-8 border-t border-line pt-10 mt-12 pb-16">
|
|
142
|
-
<h2 class="text-balance text-2xl font-semibold">Where to go next</h2>
|
|
143
|
-
<div class="mt-5 grid gap-5 sm:grid-cols-2">
|
|
144
|
-
<a class="rounded-lg border border-line bg-board p-5 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./components/"><h3 class="text-balance text-lg font-semibold">Components and modules</h3><p class="mt-2 text-pretty text-sm leading-6 text-muted">Find examples for resistors, LEDs, switches, ICs, OLEDs, and sensors.</p></a>
|
|
145
|
-
<a class="rounded-lg border border-line bg-board p-5 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./dsl/"><h3 class="text-balance text-lg font-semibold">DSL reference</h3><p class="mt-2 text-pretty text-sm leading-6 text-muted">Look up declarations, hole references, and CLI commands.</p></a>
|
|
146
|
-
</div>
|
|
147
|
-
</section>
|
|
148
|
-
</main>
|
|
149
|
-
|
|
150
|
-
<nav class="hidden xl:col-span-2 xl:block xl:self-start xl:sticky xl:top-8" aria-label="On this page">
|
|
151
|
-
<p class="mb-4 text-sm font-semibold">On this page</p>
|
|
152
|
-
<ul class="space-y-3 border-l border-line pl-4 text-sm text-muted">
|
|
153
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#setup">Set up</a></li>
|
|
154
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#led-example">Code and output</a></li>
|
|
155
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#holes">Holes and rails</a></li>
|
|
156
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#module-example">Modules</a></li>
|
|
157
|
-
<li><a class="hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="#next">Next steps</a></li>
|
|
158
|
-
</ul>
|
|
159
|
-
</nav>
|
|
160
|
-
</div>
|
|
161
|
-
<footer class="border-t border-line"><div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-3 px-5 py-7 text-sm text-muted sm:px-8 lg:px-10"><p>Diagrams are generated from Breadkit examples.</p><a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="../">Back to home</a></div></footer>
|
|
162
|
-
</body>
|
|
163
|
-
</html>
|
data/site/index.html
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="theme-color" content="#101719">
|
|
7
|
-
<meta name="description" content="Describe breadboard components and wiring in Ruby, then inspect connections, render diagrams, and catch mistakes.">
|
|
8
|
-
<title>Breadkit | Describe your breadboard circuit</title>
|
|
9
|
-
<link rel="canonical" href="https://breadkit.github.io/breadkit/">
|
|
10
|
-
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
11
|
-
<link rel="stylesheet" href="./assets/site.css">
|
|
12
|
-
</head>
|
|
13
|
-
<body class="min-h-dvh bg-ink font-sans text-paper antialiased">
|
|
14
|
-
<a class="sr-only rounded-sm bg-copper px-4 py-3 font-semibold text-ink focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:outline-2 focus:outline-offset-4 focus:outline-paper" href="#main">Skip to content</a>
|
|
15
|
-
<header class="border-b border-line">
|
|
16
|
-
<div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-4 px-5 py-5 sm:px-8 lg:px-10">
|
|
17
|
-
<a class="flex items-center gap-3 rounded-sm text-xl font-semibold focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./" aria-label="Breadkit home">
|
|
18
|
-
<img class="size-8" src="./favicon.svg" alt="" width="32" height="32">
|
|
19
|
-
<span>breadkit</span>
|
|
20
|
-
</a>
|
|
21
|
-
<nav aria-label="Main navigation" class="flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-muted">
|
|
22
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/">Guide</a>
|
|
23
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/components/">Components</a>
|
|
24
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/dsl/">Reference</a>
|
|
25
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-render/">Render</a>
|
|
26
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://breadkit.github.io/breadkit-lint/">Lint</a>
|
|
27
|
-
<a class="rounded-sm hover:text-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit/breadkit">GitHub</a>
|
|
28
|
-
</nav>
|
|
29
|
-
</div>
|
|
30
|
-
</header>
|
|
31
|
-
|
|
32
|
-
<main id="main">
|
|
33
|
-
<section class="mx-auto grid max-w-7xl items-center gap-12 px-5 py-16 sm:px-8 sm:py-20 lg:grid-cols-2 lg:gap-16 lg:px-10 lg:py-24">
|
|
34
|
-
<div class="max-w-xl">
|
|
35
|
-
<p class="mb-5 text-sm font-medium text-copper">Breadboard circuits, written in Ruby</p>
|
|
36
|
-
<h1 class="text-balance text-4xl font-semibold leading-tight sm:text-5xl lg:text-6xl">Make every connection clear.</h1>
|
|
37
|
-
<p class="mt-6 max-w-lg text-pretty text-lg leading-8 text-muted">Describe holes, components, and wires. Breadkit resolves the connections so you can render a diagram and check the same circuit for mistakes.</p>
|
|
38
|
-
<div class="mt-8 flex flex-wrap items-center gap-x-6 gap-y-4">
|
|
39
|
-
<a class="rounded-sm bg-copper px-5 py-3 font-semibold text-ink hover:bg-paper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/">Read the guide</a>
|
|
40
|
-
<a class="rounded-sm py-3 font-medium text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/components/">Browse components</a>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="mt-10 border-l-2 border-copper pl-5">
|
|
43
|
-
<p class="mb-3 text-sm text-muted">From the button and LED example</p>
|
|
44
|
-
<pre class="overflow-x-auto font-mono text-sm leading-6 text-paper"><code>board :half
|
|
45
|
-
button :SW1, at: "e10"
|
|
46
|
-
resistor :R1, "330", pins: %w[a12 a16]
|
|
47
|
-
led :D1, color: :red, anode: "b16", cathode: "b17"</code></pre>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<figure class="m-0 overflow-hidden rounded-xl border border-line bg-board">
|
|
51
|
-
<div class="flex min-h-96 items-center justify-center p-5 sm:p-8">
|
|
52
|
-
<img class="h-auto w-full max-w-xs" src="./assets/01_led_button.svg" alt="Generated half-size breadboard diagram with a switch, resistor, and LED" width="205" height="320">
|
|
53
|
-
</div>
|
|
54
|
-
<figcaption class="flex flex-wrap items-center justify-between gap-3 border-t border-line px-5 py-4 text-sm text-muted">
|
|
55
|
-
<span>SVG generated from the complete example</span>
|
|
56
|
-
<a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/#led-example">See code and output</a>
|
|
57
|
-
</figcaption>
|
|
58
|
-
</figure>
|
|
59
|
-
</section>
|
|
60
|
-
|
|
61
|
-
<section id="workflow" class="border-t border-line bg-board/60">
|
|
62
|
-
<div class="mx-auto max-w-7xl px-5 py-16 sm:px-8 lg:px-10">
|
|
63
|
-
<h2 class="text-balance text-3xl font-semibold">One circuit file, three tools</h2>
|
|
64
|
-
<ol class="mt-8 grid list-none gap-0 border-y border-line p-0 md:grid-cols-3">
|
|
65
|
-
<li class="py-6 md:pr-8"><p class="text-sm text-copper">1. Describe</p><h3 class="mt-2 text-balance text-xl font-semibold">breadkit</h3><p class="mt-3 text-pretty leading-7 text-muted">Write board holes, parts, wires, and expected connections in Ruby.</p></li>
|
|
66
|
-
<li class="border-t border-line py-6 md:border-l md:border-t-0 md:px-8"><p class="text-sm text-copper">2. Render</p><h3 class="mt-2 text-balance text-xl font-semibold">breadkit-render</h3><p class="mt-3 text-pretty leading-7 text-muted">Generate SVG or PNG diagrams from the same file.</p></li>
|
|
67
|
-
<li class="border-t border-line py-6 md:border-l md:border-t-0 md:pl-8"><p class="text-sm text-copper">3. Check</p><h3 class="mt-2 text-balance text-xl font-semibold">breadkit-lint</h3><p class="mt-3 text-pretty leading-7 text-muted">Check placement, electrical connections, and design intent.</p></li>
|
|
68
|
-
</ol>
|
|
69
|
-
</div>
|
|
70
|
-
</section>
|
|
71
|
-
|
|
72
|
-
<section class="mx-auto grid max-w-7xl gap-8 px-5 py-16 sm:px-8 lg:grid-cols-2 lg:px-10">
|
|
73
|
-
<div>
|
|
74
|
-
<h2 class="text-balance text-3xl font-semibold">Start with a working example</h2>
|
|
75
|
-
<p class="mt-4 max-w-xl text-pretty leading-7 text-muted">The guide pairs real Ruby files with their generated diagrams. Start with a button and LED, then move on to an offboard module.</p>
|
|
76
|
-
<a class="mt-6 inline-block rounded-sm font-semibold text-paper underline decoration-copper underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="./guide/">Open the user guide</a>
|
|
77
|
-
</div>
|
|
78
|
-
<div class="rounded-lg border border-line bg-board p-5">
|
|
79
|
-
<p class="mb-3 text-sm text-muted">Install and run</p>
|
|
80
|
-
<pre class="overflow-x-auto font-mono text-sm leading-7"><code>gem install breadkit breadkit-render breadkit-lint
|
|
81
|
-
bkrender circuit.bk.rb -o circuit.svg
|
|
82
|
-
bklint circuit.bk.rb</code></pre>
|
|
83
|
-
<p class="mt-4 text-pretty text-sm leading-6 text-muted">DSL files run as Ruby. Only load files you trust.</p>
|
|
84
|
-
</div>
|
|
85
|
-
</section>
|
|
86
|
-
</main>
|
|
87
|
-
|
|
88
|
-
<footer class="border-t border-line">
|
|
89
|
-
<div class="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-3 px-5 py-7 text-sm text-muted sm:px-8 lg:px-10">
|
|
90
|
-
<p>The three Breadkit tools are published in separate repositories.</p>
|
|
91
|
-
<a class="rounded-sm text-paper underline decoration-line underline-offset-4 hover:decoration-copper focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-copper" href="https://github.com/breadkit">GitHub organization</a>
|
|
92
|
-
</div>
|
|
93
|
-
</footer>
|
|
94
|
-
</body>
|
|
95
|
-
</html>
|
data/site/styles.css
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
|
|
3
|
-
@source "./**/*.html";
|
|
4
|
-
|
|
5
|
-
@theme {
|
|
6
|
-
--color-ink: #101719;
|
|
7
|
-
--color-board: #1b2423;
|
|
8
|
-
--color-line: #3d4b47;
|
|
9
|
-
--color-paper: #e8eeeb;
|
|
10
|
-
--color-muted: #a1b0aa;
|
|
11
|
-
--color-copper: #d99755;
|
|
12
|
-
--font-sans: "Avenir Next", Avenir, ui-sans-serif, system-ui, sans-serif;
|
|
13
|
-
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
14
|
-
}
|