bavovanachte / sphinx-wavedrom

A sphinx extension that allows including wavedrom diagrams by using its text-based representation
MIT License
34 stars 18 forks source link

Feature request - support .yaml files as well as .json files for input #49

Open oharboe opened 1 year ago

oharboe commented 1 year ago

It would be simple to support both. Would such a PR be considered?

yaml and json are equivalent, but I find yaml can be easier on the eye:

{ "signal": [
        { "name": "clk",  "wave": "P......" },
        { "name": "bus",  "wave": "x.==.=x", "data": ["head", "body", "tail", "data"] },
        { "name": "wire", "wave": "0.1..0." }
]}

vs

signal:
  - name: clk
    wave: P......
  - name: bus
    wave: x.==.=x
    data:
      - head
      - body
      - tail
      - data
  - name: wire
    wave: 0.1..0.
bavovanachte commented 1 year ago

Is this supported by the official wavedrom project? If not, would you suggest converting the yaml format to json and then passing it on to wavedrom or wavedrom-py?

oharboe commented 1 year ago

Is this supported by the official wavedrom project?

To my mind wavedrom just uses json as an example, there are any number of ways to represent that datamodel. json, yaml, xml(shudder), TOML(from rust)...

If not, would you suggest converting the yaml format to json and then passing it on to wavedrom or wavedrom-py?

Yes.

However, first I want to try some bigger examples in yaml and see if I still like it :-)