Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add config: allow surrounding output with backticks #4

Conversation

rvictorino
Copy link
Contributor

Hi,

thank you for this amazing work.

I needed a few extra features for a project of mine, so I added them myself.

Since I don't know if you are welcoming new additions or if this feature even is on your roadmap, feel free to reject this PR.

If you want to discuss around this work, please do.

Anyway, if you would like to know more about what I did:

The idea was that I wanted to be able to directy preview output file. I therefore needed it to have the proper backticks characters for parsers to understand it.

  • Added a new config entry: encloseWithMermaidBackticks (boolean)
  • If this entry is not set, or false, behaviour will be default (nothing more than what mermerd already does)
  • If this entry is set to true, it will prefix output by "mermaid", and insert "" right before the ending new lines.

Have a great day,

@KarnerTh
Copy link
Owner

Thanks for the PR and the detailed description!
This feature is sure to be useful for others as well and your implementation fits perfectly - I will happily accept the PR.

FYI: after the merge I will update the readme and also add the possibility to set the config via the command line (also the go.mod and go.sum seem a bit weird) . After that I will publish a new version.

@KarnerTh KarnerTh merged commit 1d7d65b into KarnerTh:master Mar 17, 2022
@KarnerTh
Copy link
Owner

@rvictorino The new version with your feature is available (v0.0.5)

I fixed the issue that you added the backticks suffix multiple times after each table definition, which breaks the diagram if you have multiple tables or constraints e.g. in the GitHub markdown previewer. If I got it right, all the mermaid syntax needs to be in one opening and closing block.

@rvictorino
Copy link
Contributor Author

Thanks for your quick feedback. Your are right, the prefix and suffix must only be added once. Sorry that I missed that ! (I'm totally new to golang).

Thanks again for the great work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants