Add Mermaid SVG/PNG CLI renderer#175
Open
IstiN wants to merge 109 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds top-level CLI support for Mermaid rendering by routing mermaid_to_svg / mermaid_to_png through an external renderer build, so dmtools can generate diagram assets directly from Mermaid text.
Changes:
- Added a composite build/submodule reference for
dmtools-mermaid-renderer. - Wired new Mermaid CLI commands into
JobRunnerand updated help text. - Added integration-style tests covering SVG and PNG rendering from the CLI.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
settings.gradle |
Registers the external Mermaid renderer as an included build. |
dmtools-core/src/main/java/com/github/istin/dmtools/job/JobRunner.java |
Dispatches Mermaid CLI commands and documents them in help output. |
dmtools-core/src/test/java/com/github/istin/dmtools/job/JobRunnerMcpIntegrationTest.java |
Adds CLI tests for SVG and PNG rendering. |
dmtools-core/build.gradle |
Adds the Mermaid renderer dependency to dmtools-core. |
.gitmodules |
Declares the new renderer submodule checkout path and URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,2 +1,3 @@ | |||
| rootProject.name = 'dmtools-cli' | |||
| include 'dmtools-core', 'dmtools-mcp-annotations', 'dmtools-annotation-processor' | |||
| includeBuild 'dmtools-mermaid-renderer' | |||
Comment on lines
+121
to
+129
| JobRunner.main(new String[]{ | ||
| "mermaid_to_svg", | ||
| "flowchart TD; A[Start] --> B[Done]", | ||
| "--output", | ||
| output.toString() | ||
| }); | ||
|
|
||
| assertTrue(outContent.toString().contains(output.toAbsolutePath().normalize().toString())); | ||
| assertTrue(Files.readString(output, StandardCharsets.UTF_8).contains("<svg")); |
Comment on lines
+140
to
+149
| JobRunner.main(new String[]{ | ||
| "mermaid_to_png", | ||
| "flowchart TD; A[Start] --> B[Done]", | ||
| "--output", | ||
| output.toString() | ||
| }); | ||
|
|
||
| assertTrue(outContent.toString().contains(output.toAbsolutePath().normalize().toString())); | ||
| byte[] header = Files.readAllBytes(output); | ||
| assertArrayEquals(new byte[]{(byte) 0x89, 0x50, 0x4E, 0x47}, new byte[]{header[0], header[1], header[2], header[3]}); |
…nd title clipping Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…bottom padding Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… fix 'Runs dmtools mermaid_to_png' now wraps to 2 lines matching Playwright output. 95 unit tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Validation
Note: ZenUML is registered through @mermaid-js/mermaid-zenuml, but still reports an unresolved async promise under GraalJS in the renderer compatibility report.