Terrace/docs/parser/section.js
2023-02-11 22:30:10 -05:00

28 lines
506 B
JavaScript

const parseSection = require('./section.js')
const knownBlocks = {
'logo': () => {},
'div': () => {},
'markdown': () => {},
}
module.exports = async function(doc, rootLevel) {
const { next, line, match, tail, level, head } = doc
const section = {
class: '',
children: []
}
while (await next(rootLevel)) {
if (!head()) continue
const block = head()
if (!knownBlocks[block]) continue
// TODO: Start Parsing
section.children.push(line())
}
return section
}