breadkit 0.1.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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +16 -0
- data/SECURITY.md +5 -0
- data/data/boards/full.yml +18 -0
- data/data/boards/half.yml +17 -0
- data/data/boards/mini.yml +8 -0
- data/data/parts/2n3906.yml +10 -0
- data/data/parts/arduino_uno.yml +34 -0
- data/data/parts/bc547.yml +10 -0
- data/data/parts/bc557.yml +10 -0
- data/data/parts/capacitor.yml +7 -0
- data/data/parts/diode.yml +8 -0
- data/data/parts/electrolytic.yml +8 -0
- data/data/parts/led.yml +9 -0
- data/data/parts/ne555.yml +16 -0
- data/data/parts/pot.yml +12 -0
- data/data/parts/resistor.yml +7 -0
- data/data/parts/tact_switch_6mm.yml +19 -0
- data/data/parts/transistor.yml +10 -0
- data/docs/assets/01_led_button.svg +12 -0
- data/docs/dsl.md +62 -0
- data/exe/breadkit +5 -0
- data/lib/breadkit/analysis.rb +382 -0
- data/lib/breadkit/board.rb +163 -0
- data/lib/breadkit/cli.rb +61 -0
- data/lib/breadkit/dsl.rb +182 -0
- data/lib/breadkit/hole_id.rb +46 -0
- data/lib/breadkit/ir.rb +215 -0
- data/lib/breadkit/model.rb +31 -0
- data/lib/breadkit/part_library.rb +125 -0
- data/lib/breadkit/resolver.rb +449 -0
- data/lib/breadkit/value.rb +50 -0
- data/lib/breadkit/version.rb +5 -0
- data/lib/breadkit.rb +26 -0
- data/package-lock.json +1172 -0
- data/package.json +12 -0
- data/schema/ir-v1.json +128 -0
- data/schema/part-v1.json +48 -0
- data/sig/breadkit.rbs +180 -0
- data/site/assets/01_led_button.svg +14 -0
- data/site/assets/03_arduino_blink.svg +14 -0
- data/site/favicon.svg +7 -0
- data/site/guide/components/index.html +113 -0
- data/site/guide/dsl/index.html +132 -0
- data/site/guide/index.html +163 -0
- data/site/index.html +95 -0
- data/site/styles.css +14 -0
- metadata +94 -0
|
@@ -0,0 +1,163 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
metadata
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: breadkit
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Yudai Takada
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Breadkit resolves breadboard wiring DSL files into deterministic circuit
|
|
13
|
+
connectivity and JSON IR.
|
|
14
|
+
email:
|
|
15
|
+
- t.yudai92@gmail.com
|
|
16
|
+
executables:
|
|
17
|
+
- breadkit
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- LICENSE.txt
|
|
22
|
+
- README.md
|
|
23
|
+
- SECURITY.md
|
|
24
|
+
- data/boards/full.yml
|
|
25
|
+
- data/boards/half.yml
|
|
26
|
+
- data/boards/mini.yml
|
|
27
|
+
- data/parts/2n3906.yml
|
|
28
|
+
- data/parts/arduino_uno.yml
|
|
29
|
+
- data/parts/bc547.yml
|
|
30
|
+
- data/parts/bc557.yml
|
|
31
|
+
- data/parts/capacitor.yml
|
|
32
|
+
- data/parts/diode.yml
|
|
33
|
+
- data/parts/electrolytic.yml
|
|
34
|
+
- data/parts/led.yml
|
|
35
|
+
- data/parts/ne555.yml
|
|
36
|
+
- data/parts/pot.yml
|
|
37
|
+
- data/parts/resistor.yml
|
|
38
|
+
- data/parts/tact_switch_6mm.yml
|
|
39
|
+
- data/parts/transistor.yml
|
|
40
|
+
- docs/assets/01_led_button.svg
|
|
41
|
+
- docs/dsl.md
|
|
42
|
+
- exe/breadkit
|
|
43
|
+
- lib/breadkit.rb
|
|
44
|
+
- lib/breadkit/analysis.rb
|
|
45
|
+
- lib/breadkit/board.rb
|
|
46
|
+
- lib/breadkit/cli.rb
|
|
47
|
+
- lib/breadkit/dsl.rb
|
|
48
|
+
- lib/breadkit/hole_id.rb
|
|
49
|
+
- lib/breadkit/ir.rb
|
|
50
|
+
- lib/breadkit/model.rb
|
|
51
|
+
- lib/breadkit/part_library.rb
|
|
52
|
+
- lib/breadkit/resolver.rb
|
|
53
|
+
- lib/breadkit/value.rb
|
|
54
|
+
- lib/breadkit/version.rb
|
|
55
|
+
- package-lock.json
|
|
56
|
+
- package.json
|
|
57
|
+
- schema/ir-v1.json
|
|
58
|
+
- schema/part-v1.json
|
|
59
|
+
- sig/breadkit.rbs
|
|
60
|
+
- site/assets/01_led_button.svg
|
|
61
|
+
- site/assets/03_arduino_blink.svg
|
|
62
|
+
- site/favicon.svg
|
|
63
|
+
- site/guide/components/index.html
|
|
64
|
+
- site/guide/dsl/index.html
|
|
65
|
+
- site/guide/index.html
|
|
66
|
+
- site/index.html
|
|
67
|
+
- site/styles.css
|
|
68
|
+
homepage: https://github.com/breadkit/breadkit
|
|
69
|
+
licenses:
|
|
70
|
+
- MIT
|
|
71
|
+
metadata:
|
|
72
|
+
homepage_uri: https://github.com/breadkit/breadkit
|
|
73
|
+
source_code_uri: https://github.com/breadkit/breadkit/tree/main
|
|
74
|
+
bug_tracker_uri: https://github.com/breadkit/breadkit/issues
|
|
75
|
+
documentation_uri: https://github.com/breadkit/breadkit/tree/main/docs
|
|
76
|
+
rubygems_mfa_required: 'true'
|
|
77
|
+
rdoc_options: []
|
|
78
|
+
require_paths:
|
|
79
|
+
- lib
|
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - ">="
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: '3.3'
|
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
requirements: []
|
|
91
|
+
rubygems_version: 4.0.16
|
|
92
|
+
specification_version: 4
|
|
93
|
+
summary: Describe and analyze breadboard circuits with a Ruby DSL.
|
|
94
|
+
test_files: []
|