diff options
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/parseStructureFile.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/parse/parseStructureFile.js b/lib/parse/parseStructureFile.js index bdb97db..fe8c935 100644 --- a/lib/parse/parseStructureFile.js +++ b/lib/parse/parseStructureFile.js @@ -24,9 +24,22 @@ function parseFile(fs, file, type) { return fs.readAsString(filepath) .then(function(content) { + if (type === 'readme') { + return parser.parseReadme(content); + } else if (type === 'glossary') { + return parser.parseGlossary(content); + } else if (type === 'summary') { + return parser.parseSummary(content); + } else if (type === 'langs') { + return parser.parseLanguages(content); + } else { + throw new Error('Parsing invalid type "' + type + '"'); + } + }) + .then(function(result) { return [ file, - parser[type](content) + result ]; }); } |