Files
angular-docs-cn/aio/tools/transforms/angular-base-package/readers/json.js
T

19 lines
503 B
JavaScript
Raw Normal View History

/**
2017-03-31 21:10:54 +01:00
* Read in JSON files
*/
2017-03-31 21:10:54 +01:00
module.exports = function jsonFileReader() {
return {
2017-03-31 21:10:54 +01:00
name: 'jsonFileReader',
getDocs: function(fileInfo) {
// We return a single element array because content files only contain one document
return [{
2017-03-31 21:10:54 +01:00
docType: fileInfo.baseName + '-json',
data: JSON.parse(fileInfo.content),
template: 'json-doc.template.json',
2017-03-31 21:10:54 +01:00
id: fileInfo.baseName,
aliases: [fileInfo.baseName, fileInfo.relativePath]
}];
}
};
};