Fix for issue #204, added width option to the CLI. Default value for width is 1200.

Added logger using es6 syntax
This commit is contained in:
knsv
2015-10-19 21:36:55 +02:00
parent 57b731842b
commit b43e695da2
22 changed files with 994 additions and 522 deletions

View File

@@ -27,6 +27,7 @@ function cli(options) {
, sequenceConfig: 'c'
, ganttConfig: 'g'
, css: 't'
, width: 'w'
}
, 'boolean': ['help', 'png', 'svg']
, 'string': ['outputDir']
@@ -50,6 +51,7 @@ function cli(options) {
, " -g --ganttConfig Specify the path to the file with the configuration to be applied in the gantt diagram"
, " -h --help Show this message"
, " -v --verbose Show logging"
, " -w --width width of the generated png (number)"
, " --version Print version and quit"
]
@@ -97,11 +99,8 @@ cli.prototype.parse = function(argv, next) {
options.sequenceConfig = checkConfig(options.sequenceConfig)
}
if (options.ganttConfig) {
console.log('Got conf1'+options.ganttConfig);
options.ganttConfig = checkConfig(options.ganttConfig)
console.log('Got conf'+options.ganttConfig);
}
if (options.css) {
@@ -114,6 +113,11 @@ cli.prototype.parse = function(argv, next) {
options.css = fs.readFileSync(path.join(__dirname, '..', 'dist', 'mermaid.css'))
}
// set svg/png flags appropriately
if(!options.width){
options.width = 1200;
}
this.checkPhantom = createCheckPhantom(options.phantomPath)
this.checkPhantom(function(err, path) {