docs: function generateDiagram(title, diagram, filename) {
          // Generate content for sequences
  		if (diagram._chartType == 'sequence') {
  			var msg = diagram._messages;
  			var convertedString = "";
  			if (msg !== undefined) {	
  				var size = Object.keys(msg).length;
  				for (var i = 0; i < size; i++) {
  					var m = msg[i+""];
  					var s = "";
  					if (m._type != "note") {
  						var type = "->" ;
  						if (m._type == "callback") 
  							type = "-->"						
  						s = m._origin + type + m._destination + ": " + m._message + "\\n";
  					} else {
  					    var location = m._location;
  						if (m._location == "right" || m._location == "left") 	
  							location = m._location + " of";
  						s = "Note "+ location +" "+m._origin+ ": " + m._message + "\\n";
  					}
  					convertedString += s;
  				};
  			};
  			var diagramData = {
  				title: title,
  				header: diagram._chartTitle,
  				description: diagram._chartDesc,
  				content: convertedString
  			};      
  			var diagramPath = path.join(outdir, filename), html = view.render('sequence-diagram.tmpl', diagramData);   			
  			fs.writeFileSync(diagramPath, html, 'utf8');
  		} else if (diagram._chartType == 'class') {
  			
  			var classes = {};
  			for (var elem in diagram._entities) {
  				var x = Math.floor((Math.random() * 400) + 1);
  				var y = Math.floor((Math.random() * 300) + 1);
  				classes[diagram._entities[elem].name] = {
  				    type: diagram._entities[elem].type ,
  					position: { x: x , y: y } ,
  					size: { width: 240, height: 100 } ,
  					name: diagram._entities[elem].name
  				};
  			}
  			var relations = {};		
  			for (var elem in diagram._relations) {
  				var size = Object.keys(relations).length; 
  				relations[size] = {
  				    type: diagram._relations[elem].type ,
  					source: diagram._relations[elem].source ,					
  					target: diagram._relations[elem].target
  				};
  			}
  			
  			var diagramData = {
  				title: title,
  				header: diagram._chartTitle,
  				description: diagram._chartDesc,
  				content: JSON.stringify(diagram),
  				relations: JSON.stringify(relations),
  				entities: JSON.stringify(classes)
  			};      
  			var diagramPath = path.join(outdir, filename), html = view.render('class-diagram.tmpl', diagramData);   			
  			fs.writeFileSync(diagramPath, html, 'utf8');
  		}
      }