const markdownInclude = require('markdown-include') const file = require('./file') const markdown = {} markdown.createTable = function (data, cols) { let output = '\n' output += ' \n ' for (let column of cols) { output += `` } output += '\n \n' output += ' \n' for (let item of data) { output += ' ' let i = 0 for (let prop in item) { const column = cols[i] let nowrap = column.nowrap let align = column.align output += `` i++ } output += '\n' } output += ' \n' output += '
${column.name}
${item[prop]}
' return output } markdown.compile = function (filepath) { markdownInclude.compileFiles(file.resolve(filepath)) } module.exports = markdown