Add docstring for parseDirectory

pull/3/head
Brogan Clements 2021-12-03 13:41:03 -05:00
parent 6b10eea938
commit a6055be88a
1 changed files with 8 additions and 0 deletions

View File

@ -224,6 +224,14 @@ let parseMarkdown = function (doc) {
return {sections: sections, errors: errors};
};
/**
* Parses a single directory's md files and converts them into usable json
* @param {String} directory A string pointing to a directory
* @returns {Object} An object containing two values, dirJson and dirErrors.
* dirJson contains all data that was successfully parsed from
* the markdown files. dirErrors contains all entries that had
* an error occur while parsing.
*/
function parseDirectory(directory) {
let dirChildren = []; // this will hold the output each markdown doc
let dirErrors = []; //contains error for a given directory