Started working on JS docs.
This commit is contained in:
@@ -8,15 +8,23 @@ module.exports = async (doc, rootLevel) => {
|
||||
const node = {
|
||||
type: head(),
|
||||
class: '',
|
||||
languages: {}
|
||||
summaryClass: 'mb-[400px]',
|
||||
preClass: 'max-h-[400px]',
|
||||
examples: []
|
||||
}
|
||||
|
||||
while (await next(rootLevel)) {
|
||||
if (match('class')) node.class = tail()
|
||||
if (match('summary-class')) node.summaryClass = tail()
|
||||
if (match('pre-class')) node.preClass = tail()
|
||||
|
||||
const languageLevel = level()
|
||||
const exampleLevel = level()
|
||||
if (languages.includes(head())) {
|
||||
node.languages[head()] = await contentAsText(doc, languageLevel)
|
||||
node.examples.push({
|
||||
language: head(),
|
||||
name: tail() || '',
|
||||
code: await contentAsText(doc, exampleLevel)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user