breadkit-render 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b3d7b06780f100a70e85853569136f7123912ce7708629d9d797f22190396c4f
4
+ data.tar.gz: beadb4b786adbe2b8250f0bc1a9fae04eab46eed4df6e011c0809cc5259070c3
5
+ SHA512:
6
+ metadata.gz: e69e57aec01703ba0d6bdf4fe1c74228ee1b68f2c4dfb92f8e4c063e7294f31a1c423696710e43619bbf4ad6bd16476108bba24edc7657808f04b14783459d53
7
+ data.tar.gz: 8faa7a544c38cbe3ac009b82588d2eb9357810eccd891c27dcbd4a396a3d3a6de116f795dee9a257fdcba78b7b14426047a2fd8d21a15ba05ed9d803047ad2f8
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.0 — 2026-09-27
6
+
7
+ - Initial release.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Yudai Takada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # breadkit-render
2
+
3
+ Project site: https://breadkit.github.io/breadkit-render/
4
+
5
+ `bkrender` turns a Breadkit DSL or resolved IR JSON file into a standalone SVG diagram. Breadkit DSL input is executable Ruby; only render files you trust. IR JSON is the data-only alternative.
6
+
7
+ Install `breadkit-render` directly; RubyGems installs its compatible `breadkit` core dependency. Shared circuit examples are in the [breadkit repository](https://github.com/breadkit/breadkit/tree/main/examples).
8
+
9
+ ```sh
10
+ bkrender circuit.bk.rb -o circuit.svg --show-nets --legend
11
+ bkrender circuit.bk.rb -o circuit.png --scale 3 --theme light
12
+ bkrender circuit.bk.rb -o circuit.svg --orientation landscape
13
+ bkrender circuit.bk.rb -o circuit.svg --rail-pattern '+--+'
14
+ bkrender circuit.bk.rb --format svg > circuit.svg
15
+ ```
16
+
17
+ ## Example output
18
+
19
+ Generated from the shared [RP2040 sensor demo](https://github.com/breadkit/breadkit/blob/main/examples/05_sensor_demo.bk.rb). It uses the full-size 830-point board model. The image crops to the used area: the controller occupies rows 1–20, with switches and IR connections below and OLED/SHT31 modules beside it.
20
+
21
+ Rendered with `bkrender ../breadkit/examples/05_sensor_demo.bk.rb -o docs/images/sensor-demo.png --crop auto --rail-pattern '+--+' --scale 2`:
22
+
23
+ <img src="docs/images/sensor-demo.png" alt="RP2040 sensor demo on a full-size breadboard with OLED, two SHT31 modules, two switches, and IR receiver and emitter wiring" width="800">
24
+
25
+ [Open the interactive SVG](docs/images/sensor-demo.svg). Its layer tabs isolate power, I2C, switches, IR, and the optional 5 V emitter wiring. The 5 V view is a dashed, visual-only alternative: remove the emitter's 3.3 V rail wire before applying it.
26
+
27
+ The shared example defines the board and IR connectors in the breadkit repository's [`examples/parts`](https://github.com/breadkit/breadkit/tree/main/examples/parts). Pin `type:` values such as `power`, `ground`, `clock`, `data`, `address`, and `interrupt` color the markers. `offboard` modules use a neutral surface color; connected pin names are emphasized, unused pins are muted, and `address:` text is shown on the module. Assign `layer:` to wires and components to create matching interactive views. `route: :edge` routes long wires outside the board and separates wires that would otherwise overlap.
28
+
29
+ Resistors use four color bands by default. Set `bands: 5` on a resistor for three significant digits and a 1% brown tolerance band.
30
+
31
+ ## Options
32
+
33
+ | Option | Default | Description |
34
+ | --- | --- | --- |
35
+ | `-o, --output PATH` | stdout | Write to a file; `.svg`, `.png`, `.jpg`, and `.jpeg` select the format. |
36
+ | `-f, --format FORMAT` | inferred or `svg` | `svg`, `png`, or `jpeg`. Conflicting extensions are errors. |
37
+ | `--scale N` | `2` | Raster output scale. |
38
+ | `--theme NAME` | `light` | `light`, `dark`, or `print`. |
39
+ | `--orientation NAME` | `portrait` | `portrait` for a readable vertical board; `landscape` for a wide view. |
40
+ | `--rail-pattern PATTERN` | board layout | Assign `+`/`-` to the four rails in portrait order: left outer, left inner, right inner, right outer. Accepted patterns: `+--+`, `+-+-`, `-+-+`, `-++-`. Rail connections move with their assigned polarity. |
41
+ | `--color-by MODE` | `wire` | Use declared wire colors or deterministic net colors. |
42
+ | `--show-nets` | off | Add net labels to the diagram. |
43
+ | `--legend` | off | Add the title, connected net names, and representative wire colors. |
44
+ | `--crop MODE` | `auto` | `auto` crops to circuit content; `none` shows the full board. |
45
+ | `--annotations FILE` | none | Overlay offenses from `bklint --format json`. |
46
+ | `--backend NAME` | `auto` | Raster backend: `rsvg`, `vips`, or `magick`. |
47
+ | `--background COLOR` | white | JPEG background: basic CSS color name, `#RGB`, or `#RRGGBB`. PNG and SVG reject this option. |
48
+ | `--quality N` | `90` | JPEG quality. |
49
+ | `--static` | off | Omit SVG layer controls and embedded scripts. |
50
+ | `--force` | off | Draw resolved elements even when the input has layout errors. |
51
+
52
+ ## Raster backends
53
+
54
+ SVG is rendered without extra dependencies. PNG uses the first available backend in the order `rsvg-convert`, `ruby-vips`, ImageMagick. JPEG uses `ruby-vips` or ImageMagick and is flattened onto the configured background. Install `librsvg` (`brew install librsvg` or `apt install librsvg2-bin`) or ImageMagick for raster output. `ruby-vips` also needs a libvips build with SVG support.
55
+
56
+ Connected breadboard holes and physically occupied holes use different markers. LED colors accept CSS color names and hexadecimal colors such as `#6d5af0`.
57
+
58
+ The SVG uses a system font stack including Noto Sans JP. Rasterized Japanese labels need a Japanese font installed in the environment.
data/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security policy
2
+
3
+ DSL files are executable Ruby. Do not process files from untrusted sources; use IR JSON for data-only input.
4
+
5
+ Please report suspected vulnerabilities privately through GitHub's Security Advisories feature. Do not include exploit details in a public issue.
Binary file