@enkidevs/curriculum-helpers

9.1.2 • Public • Published

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"
        }
      ]
    }
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @enkidevs/curriculum-helpers

Weekly Downloads

7

Version

9.1.2

License

MIT

Unpacked Size

4.96 kB

Total Files

13

Last publish

Collaborators

  • kapnobatai137
  • spypsy
  • mathieudutour
  • lukem512
  • stefanoeb
  • loopiezlol
  • nem035
  • oliviaoddo
  • pedromdrp
  • lizthedeveloper
  • sourabhv
  • milesflo
  • mihaiberq
  • enkici