Add docstring to parseMarkdown

pull/3/head
Brogan Clements 2021-12-03 15:05:32 -05:00
parent c6c446c82d
commit b3d42a3677
1 changed files with 5 additions and 0 deletions

View File

@ -165,6 +165,11 @@ function getMediaFromDirectory(dir) {
return mediaType;
}
/**
* Turns a single markdown file into the json structure needed
* @param {path} doc - a single file path to a markdown file
* @returns {object} Json object of entries in the md file
*/
function parseMarkdown(doc) {
let tree = remark.parse(doc).children;
let sections = []; // This will go into root object later