@enkidevs/curriculum-helpers
v9.1.2
Published
Helpers for parsing/transforming/compiling Enki Curriculum from and to different formats
Downloads
148
Maintainers
Keywords
Readme
Enki Curriculum Helpers
Helpers for parsing/transforming/compiling Enki Curriculum from and to different formats.
See Enki curriculum processors for more details.
const { contentTypes, compactAst } = require("@enkidevs/curriculum-helpers")
const { getParser } = require("@enkidevs/curriculum-parser")
console.log(
JSON.stringify(
compactAst(
getParser(contentTypes.INSIGHT).parseSync(`---
author: enki
---
# This is an \`example\`
`)
),
null,
2
)
)
Logs
{
"type": "root",
"children": [
{
"type": "yaml",
"value": "author: enki",
"data": {
"parsedValue": {
"author": "enki"
}
}
},
{
"type": "headline",
"children": [
{
"type": "text",
"value": "This is an "
},
{
"type": "inlineCode",
"value": "example"
}
]
}
]
}