Flesh out about page.
This commit is contained in:
19
docs/src/parser/nodes/CodeBlock.js
Normal file
19
docs/src/parser/nodes/CodeBlock.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { contentAsText } = require('../helpers')
|
||||
|
||||
module.exports = async (doc, rootLevel) => {
|
||||
const { next, level, line, head, tail, match } = doc
|
||||
|
||||
const node = {
|
||||
type: head(),
|
||||
language: tail(),
|
||||
class: '',
|
||||
text: ''
|
||||
}
|
||||
|
||||
while (await next(rootLevel)) {
|
||||
if (match('class')) node.class = tail()
|
||||
else node.text = await contentAsText(doc, rootLevel, true)
|
||||
}
|
||||
|
||||
return node
|
||||
}
|
||||
Reference in New Issue
Block a user