| 
									
										
										
										
											2015-08-03 17:45:58 -07:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2015-11-04 10:47:05 +00:00
										 |  |  |  * dgProcessor | 
					
						
							| 
									
										
										
										
											2015-08-03 17:45:58 -07:00
										 |  |  |  * @description | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2015-11-04 10:47:05 +00:00
										 |  |  | module.exports = function renderAsMarkdownProcessor() { | 
					
						
							| 
									
										
										
										
											2015-08-03 17:45:58 -07:00
										 |  |  |   return { | 
					
						
							|  |  |  |     $runAfter: ['readFilesProcessor'], | 
					
						
							|  |  |  |     $runBefore: ['writing-files'], | 
					
						
							|  |  |  |     $process: function(docs) { | 
					
						
							|  |  |  |       return docs.map(function(doc) { | 
					
						
							|  |  |  |         var fileInfo = doc.fileInfo; | 
					
						
							|  |  |  |         doc.renderedContent =  '```\n' + doc.content + '\n```'; | 
					
						
							|  |  |  |         var regionSuffix =  (doc.regionName && doc.regionName.length) ? "-" + doc.regionName.trim() : ""; | 
					
						
							|  |  |  |         var origName = fileInfo.baseName + "." + fileInfo.extension; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         var newName = fileInfo.baseName + regionSuffix +  "." + fileInfo.extension + ".md"; | 
					
						
							|  |  |  |         doc.outputPath = fileInfo.relativePath.replace(origName, newName); | 
					
						
							|  |  |  |         return doc; | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | }; |