Start working on responsiveness and about page.

This commit is contained in:
Joshua Bemenderfer
2023-02-13 22:09:29 -05:00
parent 6dce7ff031
commit 8b9a136d88
22 changed files with 106 additions and 47 deletions

View File

@@ -0,0 +1,24 @@
const { contentAsText } = require('../helpers')
const languages = ['terrace', 'json', 'yaml', 'toml', 'javascript', 'typescript', 'c', 'python']
module.exports = async (doc, rootLevel) => {
const { next, level, line, head, tail, match } = doc
const node = {
type: head(),
class: '',
languages: {}
}
while (await next(rootLevel)) {
if (match('class')) node.class = tail()
const languageLevel = level()
if (languages.includes(head())) {
node.languages[head()] = await contentAsText(doc, languageLevel)
}
}
return node
}