First work on actual site contents.
This commit is contained in:
@@ -6,8 +6,7 @@ module.exports.contentAsText = async function(doc, rootLevel) {
|
||||
let contentDepth = -1
|
||||
|
||||
while(await next(rootLevel)) {
|
||||
if (!line()) continue
|
||||
if (contentDepth === -1) contentDepth = level()
|
||||
if (contentDepth === -1 && !!line()) contentDepth = level()
|
||||
|
||||
const indent = ''.padStart(level() - contentDepth, ' ')
|
||||
linesAsArray.push(indent + line())
|
||||
|
||||
@@ -5,7 +5,7 @@ const languages = ['terrace', 'json', 'yaml', 'toml', 'javascript', 'typescript'
|
||||
module.exports = async (doc, rootLevel) => {
|
||||
const { next, level, line, head, tail } = doc
|
||||
const codeExample = {
|
||||
type: 'code-example',
|
||||
type: 'CodeExample',
|
||||
languages: {}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ const marked = require('marked')
|
||||
|
||||
module.exports = async (...args) => {
|
||||
return {
|
||||
type: `markdown`,
|
||||
type: `Markdown`,
|
||||
text: marked.parse(await contentAsText(...args))
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
const parseNode = require('./node.js')
|
||||
const parseNode = require('./Node.js')
|
||||
|
||||
module.exports.section = parseNode
|
||||
module.exports.div = parseNode
|
||||
module.exports.logo = doc => ({ type: `logo` })
|
||||
module.exports.markdown = require('./markdown.js')
|
||||
module.exports['code-example'] = require('./code-example.js')
|
||||
module.exports.Section = parseNode
|
||||
module.exports.Div = parseNode
|
||||
module.exports.Logo = doc => ({ type: `Logo` })
|
||||
module.exports.Markdown = require('./Markdown.js')
|
||||
module.exports.CodeExample = require('./CodeExample.js')
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = async function(doc) {
|
||||
const { next, line, match, tail, level, head } = doc
|
||||
|
||||
const pageData = {
|
||||
type: `page`,
|
||||
type: `Page`,
|
||||
title: '',
|
||||
description: [],
|
||||
layout: '',
|
||||
@@ -21,8 +21,8 @@ module.exports = async function(doc) {
|
||||
pageData.description.push(line(l))
|
||||
}
|
||||
}
|
||||
else if (match('section')) {
|
||||
pageData.children.push(await knownNodes.section(doc, level()))
|
||||
else if (match('Section')) {
|
||||
pageData.children.push(await knownNodes.Section(doc, level()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user