feat: take just the relevant changes from #17 - #50
Draft
domWalters wants to merge 1 commit into
Draft
Conversation
domWalters
commented
Mar 15, 2025
Owner
Author
There was a problem hiding this comment.
All the changes to this file can be ignored.
Owner
Author
There was a problem hiding this comment.
Once mermaid-cli is integrated back into develop, this could be used as a simple example.
Owner
Author
There was a problem hiding this comment.
Investigate what this achieves.
Owner
Author
There was a problem hiding this comment.
Investigate what this achieves.
| '--no-sandbox', | ||
| '--headless', | ||
| '--disable-gpu', | ||
| '--disable-software-rasterizer', |
Owner
Author
There was a problem hiding this comment.
Presumably the developer needed these flags.
We should have an option for the user to define these.
I'd suggest two settings:
- One to append to the default flags
- One to override the default flags
| image_filename = os.path.join(self.output_dir, f"diagram_{i+1}.png") | ||
|
|
||
| # Convert the Mermaid diagram to an image using mmdc. | ||
| command = f"mmdc -p ../puppeteer-config.json -i {mermaid_file.name} -o {image_filename} -b transparent --scale 4" |
Owner
Author
There was a problem hiding this comment.
Need a way to use puppeteer configs as a setting.
| def render(self, html: str) -> str: | ||
| temp = NamedTemporaryFile(delete=False, suffix='.html') | ||
| try: | ||
| mermaid_regex = r'<pre class="mermaid"><code>(.*?)</code></pre>' |
Owner
Author
There was a problem hiding this comment.
Pretty much all of this is from mermaid-cli.
Should adopt that branches version.
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.
This is the parts of #17 that are actual changes for
mermaid-cliwithout all of the deletions that made it impossible to review.I will use this branch to review.
The one commit I created as authored by @m5c, the original PR author, and committed by me.
WARNING: This PR will not merge into
mermaid-cli, I just want this to see the difference to it.