Skip to content

Commit

Permalink
Merge pull request #205 from gillesdemey/dev-default-style
Browse files Browse the repository at this point in the history
Default style when using the CLI
  • Loading branch information
knsv committed Sep 16, 2015
2 parents 4ee0f9b + 85481b2 commit c81e933
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/mermaid.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,5 @@ text {
}

.mermaid {
width:1200px;
width: auto;
}
2 changes: 2 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

this.checkPhantom = createCheckPhantom(options.phantomPath)
Expand Down
11 changes: 11 additions & 0 deletions test/cli_test-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ test('setting an output directory succeeds', function(t) {
})
})

test('not setting a css source file uses a default style', function(t) {
t.plan(1)

var cli = require(cliPath)

cli.parse([], function(err, msg, opt) {
t.ok(opt.css, 'css file is populated')
t.end()
})
})

test('setting a css source file succeeds', function(t) {
t.plan(1)

Expand Down

0 comments on commit c81e933

Please sign in to comment.