twerske fbfd4889a9 build(docs-infra): error guides in docs (#40060)
add /errors to docs
create formatting for error guides infra

PR Close #40060
2021-01-14 11:28:52 -08:00

24 lines
562 B
JavaScript

/**
* @dgService
* @description
* This file reader will pull the contents from a text file (by default .md)
*
* The doc will initially have the form:
* ```
* {
* docType: 'error',
* content: 'the content of the file',
* }
* ```
*/
module.exports = function errorFileReader() {
return {
name: 'errorFileReader',
defaultPattern: /\.md$/,
getDocs: function(fileInfo) {
// We return a single element array because content files only contain one document
return [{docType: 'error', content: fileInfo.content}];
}
};
};