Note
This tool is under active development and is not currently in a usable state. Stay tuned!
A command line utility that generates circuit schematic diagrams from code. Think Schemdraw or circuitikz, but simpler and faster!
- Is a self-contained binary.
- Is blazingly fast.
- Is easily included in
mdbook
as a preprocessor
go install github.com/sermuns/schemgo
Many other installation methods are supported!
Create a file simple.schemgo
containing:
battery.right
line.up
resistor.left
line.down
Run:
schemgo build simple.schemgo -o simple.svg
The circuit diagram is created as simple.svg
:
Note
Only svg output is supported at the moment.
- Push and pop
- Subcommands
-
build
exports svg file -
serve
serves a development website for live-preview
-
- Comments with
#
- mdBook preprocessor
- Labels
-
typst
math
-
- multiple terminal: named anchors on components?
- Components (I won't attempt before situation with polymorphsim is under control.)
- Optional style string on tags
- (Better way of defining appearances... maybe external files?)
- More components
- Battery
- Resistor
- Inductors
- Capacitor
- Node (dot)
- Voltage source
- Current source
- Diodes
- Transistors
- Amperemeter
- Voltmeter
- Switch
- GND (and 5V)?
-
@set
statement to change global defaults (stroke width, padding, color) - set standard (IEC, IEEE) on elemnt, using
set
- Element attributes
- ID for symbolic reference
- Exporting to pdf, png, jpg, webp
- Syntax highlighting, LSP
- Logic gates