This pull request allows the use of YAML in addition to JSON.
Although YAML is nearly (and divisively) a superset of JSON, JSON5 is an extension in competition with YAML and no longer quite a subset. Hence, I'm halfway expecting an outright "no", because this removes functionality currently present in the command-line interface (and/or makes it inconsistent with the rest of the wavedrom package.) That would be OK.
If the idea doesn't offend, there are a couple of ways to skin this cat:
By replacing json5 with yaml, as suggested here (with some new YAML test cases if you prefer), or
By teaching the CLI to use json5 to parse JSON files, and yaml to parse YAML files.
Why YAML? Because it allows the use of whitespace as an alternative to nested brackets and braces. Hence, step5.js could be expressed as:
This example shows YAML only as a syntactically richer alternative to JSON. There are also ways for YAML to allow injection of type information (via !Tags) and alternative structures (via &references) in ways that JSON can't. However, that opens up several other cans of worms: let's start here, and probably finish here too. Comments welcome.
This pull request allows the use of YAML in addition to JSON.
Although YAML is nearly (and divisively) a superset of JSON, JSON5 is an extension in competition with YAML and no longer quite a subset. Hence, I'm halfway expecting an outright "no", because this removes functionality currently present in the command-line interface (and/or makes it inconsistent with the rest of the wavedrom package.) That would be OK.
If the idea doesn't offend, there are a couple of ways to skin this cat:
Why YAML? Because it allows the use of whitespace as an alternative to nested brackets and braces. Hence, step5.js could be expressed as:
This example shows YAML only as a syntactically richer alternative to JSON. There are also ways for YAML to allow injection of type information (via !Tags) and alternative structures (via &references) in ways that JSON can't. However, that opens up several other cans of worms: let's start here, and probably finish here too. Comments welcome.