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

Default style when using the CLI #205

Merged
merged 3 commits into from
Sep 16, 2015

Conversation

gillesdemey
Copy link
Contributor

Uses the default Mermaid style when no explicit style is set. Fixes #196

Added a test to prevent regressions and additionally set the width of the default style to "auto".

Honestly I have no idea if setting the width to "auto" would cause any issues, the previous 1200px just generated a weirdly small image on my system.

Before:
screenshot 2015-09-15 19 26 11

After:
screenshot 2015-09-15 19 26 55

@@ -109,6 +109,8 @@ cli.prototype.parse = function(argv, next) {
} catch (err) {
this.errors.push(err)
}
} else {
options.css = fs.readFileSync(__dirname + '/../dist/mermaid.css')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer this use node's path.join to ensure it remains cross-platform safe. you'll need to var path = require('path') at the top of the file, and then this line becomes:

options.css = fs.readFileSync(path.join(__dirname, '..', 'dist', 'mermaid.css'))

@fardog
Copy link
Contributor

fardog commented Sep 16, 2015

one comment, but otherwise 👍—thanks so much for putting this together, and for writing up tests!

@knsv
Copy link
Collaborator

knsv commented Sep 16, 2015

Great!
Thanks for the pull request and thanks for the review. I will merge and apply fardogs suggested changes.

knsv added a commit that referenced this pull request Sep 16, 2015
@knsv knsv merged commit c81e933 into mermaid-js:master Sep 16, 2015
@gillesdemey gillesdemey deleted the dev-default-style branch November 25, 2021 09:52
mgenereu pushed a commit to mgenereu/mermaid that referenced this pull request Jun 25, 2022
…yarn/develop/mocha-9.0.0

Bump mocha from 8.4.0 to 9.0.0
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.

3 participants