schemgo

command module
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

README

schemgo

Let the gophers put your schematic to paper!

goreportcard-badge license-badge

[!NOTE] This tool is under active development and is not currently in a usable state. Stay tuned!

What is this?

This tool generates electrical circuit schematic diagram from code, such as Schemdraw and circuitikz.

The language is very minimal and heavily inspired by Schemdraw's.

Why choose this over Schemdraw/circuitikz?

This ships as a single binary, and is blazingly fast.

Is easily included in mdbook as a preprocessor!

Quickstart

go install github.com/sermuns/schemgo

Many other installation methods are supported!

schemgo is now available in the shell, provided you have $GOPATH/bin ($GOBIN) in your PATH.

Example usage

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:

simple circuit

[!NOTE] Only svg output is supported at the moment.









Roadmap

✅ Done

  • Push and pop
  • Subcommands
    • build exports svg file
    • serve serves a development website for live-preview
  • Comments with #
  • mdBook preprocessor

🎯 High priority

  • Labels
    • typst math
  • multiple terminal: named anchors on components?

Normal priority

  • 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL