New release

This commit is contained in:
knsv
2015-06-21 17:26:19 +02:00
parent 50219cf2d9
commit 0dc983d04a
13 changed files with 125 additions and 62 deletions

View File

@@ -42,9 +42,13 @@ var page = webpage.create()
}
, log = logger(options.verbose)
// If no css is suuplied make sure a fixed witdth is given to the gant renderer
if(phantom.args[3] !== ''){
options.ganttConfig.useWidth = 1200;
}
console.log('options');
console.log(phantom.args.length);
//console.log('options');
//console.log(options.css);
page.content = [
'<html>'
@@ -68,9 +72,7 @@ files.forEach(function(file) {
, oParser = new DOMParser()
, oDOM
, svgContent
, allElements
console.log('Gantconfig: '+options.ganttConfig);
, allElements;
// this JS is executed in this statement is sandboxed, even though it doesn't
// look like it. we need to serialize then unserialize the svgContent that's
@@ -102,7 +104,7 @@ files.forEach(function(file) {
}
if (options.svg) {
var serialize = new XMLSerializer()
var serialize = new XMLSerializer();
fs.write(
options.outputDir + fs.separator + filename + '.svg'
, serialize.serializeToString(oDOM)
@@ -239,13 +241,22 @@ function executeInPage(data) {
document.body.appendChild(sc)
}else{
console.log('NO gantt config');
sc = document.createElement("script")
scContent = document.createTextNode('mermaid.ganttConfig = {useWidth:1200};')
sc.appendChild(scContent)
document.body.appendChild(sc)
}
mermaid.initialize({
sequenceDiagram:{useMaxWidth:false}
});
mermaid.init();
svg = document.querySelector('svg')
svgValue = xmlSerializer.serializeToString(svg)
//console.log(document.body.outerHTML);
return svgValue
}