| 
									
										
										
										
											2017-02-21 16:57:19 +00:00
										 |  |  | module.exports = function convertToJsonProcessor() { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     $runAfter: ['checkUnbalancedBackTicks'], | 
					
						
							|  |  |  |     $runBefore: ['writeFilesProcessor'], | 
					
						
							|  |  |  |     docTypes: [], | 
					
						
							|  |  |  |     $process: function(docs) { | 
					
						
							|  |  |  |       const docTypes = this.docTypes | 
					
						
							|  |  |  |       docs.forEach((doc) => { | 
					
						
							|  |  |  |         if (docTypes.indexOf(doc.docType) !== -1) { | 
					
						
							|  |  |  |           const output = { | 
					
						
							|  |  |  |             title: doc.title || doc.name, | 
					
						
							| 
									
										
										
										
											2017-03-01 11:23:12 +00:00
										 |  |  |             contents: doc.renderedContent | 
					
						
							| 
									
										
										
										
											2017-02-21 16:57:19 +00:00
										 |  |  |           }; | 
					
						
							|  |  |  |           doc.renderedContent = JSON.stringify(output, null, 2); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | }; |