{"id":15502963,"url":"https://github.com/evuez/yaddl","last_synced_at":"2025-10-16T19:12:59.559Z","repository":{"id":46581243,"uuid":"331732831","full_name":"evuez/yaddl","owner":"evuez","description":"Yet Another Diagram Description Language","archived":false,"fork":false,"pushed_at":"2021-10-04T20:40:26.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T09:02:31.803Z","etag":null,"topics":["diagram","dot","graphviz","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evuez.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-21T19:30:12.000Z","updated_at":"2021-10-04T20:40:30.000Z","dependencies_parsed_at":"2022-09-04T19:01:16.496Z","dependency_job_id":null,"html_url":"https://github.com/evuez/yaddl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evuez/yaddl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fyaddl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fyaddl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fyaddl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fyaddl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evuez","download_url":"https://codeload.github.com/evuez/yaddl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fyaddl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263493401,"owners_count":23475192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diagram","dot","graphviz","hacktoberfest"],"created_at":"2024-10-02T09:11:42.482Z","updated_at":"2025-10-16T19:12:54.513Z","avatar_url":"https://github.com/evuez.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaddl\n\nA simple diagram description language.\n\nThis was made to fulfill a pretty specific need I had, so it's probably not what you're looking for.\nHowever, [`DOT`](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) might be your friend!\n\n## Usage\n\n`yaddl` can output [`DOT`](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) or `JSON`:\n\n```bash\nyaddl diagram.yaddl diagram.json\nyaddl diagram.yaddl diagram.dot\n```\n\n## Language\n\n### Defining a node\n\nThe simplest node you can define looks like this:\n\n```\n= node name\n```\n\nA `=` followed by a space and the name of the node.\n\nYou can then use additional annotations to further describe the node:\n\n - `#`: A list of comma-separated values, output is a comma-separated string in `DOT` and a list of strings in `JSON`.\n - `/`: A pair of values, space-separated. This means the first value should not contain any space. Output is a `[a, b]` list in `JSON` and `a | b` in `DOT`.\n - `'`: A string.\n\n`#` is only allowed once per node. Multiple `/` will result in a list of pairs. Multiple `'` will result in a multi-line string. Interleaving `/` or `'` with other annotations is not permitted:\n\n```\n# quux, quuz\n/ foo bar\n/ baz qux\n' Lorem ipsum\n' dolor sit\n' amet.\n```\n\nthis is valid, but this isn't:\n\n```\n/ foo bar\n# quux, quuz\n/ baz qux\n' Lorem ipsum\n' dolor sit\n' amet.\n```\n\nHowever, annotations ordering doesn't matter, and this is also valid:\n\n```\n' Lorem ipsum\n' dolor sit\n' amet.\n# quux, quuz\n/ foo bar\n/ baz qux\n```\n\nA node with every annotation:\n\n```\n= Lorem\n# quux, quuz\n/ foo bar baz\n/ bar foo\n' Lorem ipsum\n' dolor sit amet.\n```\n\nAnd the corresponding `JSON` and `DOT` outputs:\n\n```json\n{\n  \"edges\": [],\n  \"nodes\": [{\n    \"name\": \"Lorem\",\n    \"links\": [\n      [\"foo\", \"bar baz\"],\n      [\"bar\", \"foo\"]\n    ],\n    \"comment\": \"Lorem ipsum\\ndolor sit amet.\",\n    \"tags\": [\"quux\", \"quuz\"]\n  }]\n}\n```\n\n```dot\ndigraph G {\n  rankdir=\"LR\";\n  n0[shape=\"Mrecord\",label=\"Lorem|quux, quuz|Lorem ipsum\\ndolor sit amet.|{bar baz\\nfoo\\n|foo\\nbar\\n}\"];\n}\n```\n\nOutput of `dot -Tpng node.dot \u003e node.png`:\n\n![node](examples/node.png)\n\n### Defining an edge\n\nYou can define undirected, bidirected and directed edges:\n\n - `-- a b`: Undirected edge\n - `\u003c\u003e a b`: Bidirected edge\n - `-\u003e a b`: Directed edge, left to right\n - `\u003c- a b`: Directed edge, right to left\n\nWhere `a` and `b` are node names. If a node name contains spaces, use `[node name]`.\n\nEdges supports comments with `'`. Usage is the same as `'` in nodes.\n\n## Putting it all together\n\n**All nodes must be defined before edges**.\n\nNodes and edges can be separated by zero or more blank lines:\n\n```\n= Node a\n' Lorem ipsum.\n= Node b\n\n= Node-c\n-- [Node a] [Node b]\n\n-\u003e [Node a] Node-c\n' foobar\n\u003c\u003e Node-c [Node b]\n```\n\nCorresponding `JSON` and `DOT` outputs:\n\n```json\n{\n  \"edges\": [\n      {\"direction\": \"Undirected\", \"node_b\": \"Node b\", \"comment\": null, \"node_a\": \"Node a\"},\n      {\"direction\": \"Directed\", \"node_b\": \"Node-c\", \"comment\": \"foobar\", \"node_a\": \"Node a\"},\n      {\"direction\": \"Bidirected\", \"node_b\": \"Node b\", \"comment\": null, \"node_a\": \"Node-c\"}\n  ],\n  \"nodes\": [\n      {\"name\": \"Node a\", \"links\": [], \"comment\": \"Lorem ipsum.\", \"tags\": []},\n      {\"name\": \"Node b\", \"links\": [], \"comment\": null, \"tags\": []},\n      {\"name\": \"Node-c\", \"links\": [], \"comment\": null, \"tags\": []}\n  ]\n}\n```\n\n```dot\ndigraph G {\n  rankdir=\"LR\";\n  n0[shape=\"Mrecord\",label=\"Node a|Lorem ipsum.\"];\n  n1[shape=\"Mrecord\",label=\"Node b\"];\n  n2[shape=\"Mrecord\",label=\"Node-c\"];\n  n0 -\u003e n1[dir=\"none\",style=\"dotted\"];\n  n0 -\u003e n2[label=\"foobar\",dir=\"forward\"];\n  n2 -\u003e n1[dir=\"both\",style=\"bold\"];\n}\n```\n\nAnd output of `dot -Tpng example.dot \u003e example.png`:\n\n![example](examples/example.png)\n\n## Install\n\nInstall [`stack`](https://docs.haskellstack.org/en/stable/README/#how-to-install), clone this repo and run `stack install`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevuez%2Fyaddl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevuez%2Fyaddl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevuez%2Fyaddl/lists"}