| 
									
										
										
										
											2017-01-26 14:03:53 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @dgService | 
					
						
							|  |  |  |  * @description | 
					
						
							|  |  |  |  * This file reader will pull the contents from a text file (by default .md) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The doc will initially have the form: | 
					
						
							|  |  |  |  * ```
 | 
					
						
							|  |  |  |  * { | 
					
						
							|  |  |  |  *   content: 'the content of the file', | 
					
						
							|  |  |  |  *   startingLine: 1 | 
					
						
							|  |  |  |  * } | 
					
						
							|  |  |  |  * ```
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | module.exports = function contentFileReader() { | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     name: 'contentFileReader', | 
					
						
							|  |  |  |     defaultPattern: /\.md$/, | 
					
						
							|  |  |  |     getDocs: function(fileInfo) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       // We return a single element array because content files only contain one document
 | 
					
						
							| 
									
										
										
										
											2018-10-17 15:45:47 +01:00
										 |  |  |       return [{docType: 'content', content: fileInfo.content}]; | 
					
						
							| 
									
										
										
										
											2017-01-26 14:03:53 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2017-04-01 21:34:10 +03:00
										 |  |  | }; |