yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.87k stars 213 forks source link

Update wireviz version to latest #1779

Open rwarren opened 1 week ago

rwarren commented 1 week ago

Kroki currently uses wireviz v0.3.3 (which is not even an official version... see below). The latest version is v0.4.1. Updating would be very nice.


More detail...

The wireviz version currently in use is v0.3.3, per this line: https://github.com/yuzutech/kroki/blob/d96fd259e2362b39707bb5a8665ec81f2aaac4df/server/ops/docker/jdk17-noble/Dockerfile#L180

Curiously, v0.3.3 is not even an official wireviz tag!? Officail Wireviz versions jump from v0.3.2 to v0.4, so I'm not sure how v0.3.3 works.

The latest version of wireviz is v0.4.1, and it contains some significant, and long awaited, features.

NOTE: You can't even run basic wireviz tutorials with the v0.3.x version included with Kroki! For example the syntax for this wireviz tutorial currently fails with the syntax below (also available at the kroki.io renderer here):

connectors:
  X1:
    pinlabels: [+12V, GND, GND, +5V]
    type: Molex 8981
    subtype: female
  F1:
    style: simple
    type: Crimp ferrule
    subtype: 0.5 mm²
    color: OG # optional color

cables:
  W1:
    category: bundle # bundle
    length: 0.3
    gauge: 0.5 mm2
    colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit

connections:
  -
    - F1. # a new ferrule is auto-generated for each of the four wires
    - W1: [1-4]
    - X1: [1-4]

The problem is the relatively new syntax in connections: with F1.. Drop the . and it renders... but not as it should.

ggrossetie commented 1 week ago

We are using a fork: https://github.com/yuzutech/WireViz mainly because we are consuming wireviz as a binary CLI (and not as a Python library).

$ echo 'yaml definition' | wireviz -f svg - -o -

My pull request didn't get merged (https://github.com/wireviz/WireViz/pull/321) but it seems that it's now possible to specify an output file. Not sure if outputting to stdout and reading the content from stdin are supported though...