Repository navigation
Fix keyword names, hex style values and multi-board render - #11
Merged
Merged
Conversation
- Quote every D2 keyword used as a name (shadow, fill, top, ...), using the full keyword list from D2 v0.9.0. - Quote style values D2 cannot read bare, such as #dbeafe, which D2 otherwise reads as a comment. - render() takes target=, default the root board, so diagrams with layers, scenarios or steps render instead of failing on stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These three bugs turned up while writing an example for every feature:
Shape(name="shadow")was written as is, and D2 failed with "shadow must be style.shadow". The keyword list now matches D2 v0.9.0's full set, and every keyword is quoted when used as a name.Style(fill="#dbeafe")was written asfill: #dbeafe, and D2 read the#as the start of a comment. Style values are now quoted when D2 needs it. Values you already quoted, like'"#274e13"', stay as they are.render()failed on any diagram with layers, scenarios or steps, because D2 can't write several boards to stdout.render()now takestarget=, which defaults to the root board.target="layers.detail"renders one layer.There's a test for each. Checked locally: all 104 tests pass, and ruff and ty are clean.
🤖 Generated with Claude Code