Skip to content

enkidevs/curriculum-processors

Repository files navigation

Build: CircleCI

Enki Curriculum Processors

Note: The language used here follows this pattern:

  • an X parser transforms content from format X to an AST (abstract syntax tree)
  • an X compiler transforms content from an AST to format X

Enki curriculum processors are divided into packages:

The text processing architecture of Enki curriculum is based on unifiedjs, using its markdown interfaces via remarkjs.

If this is your first time interacting with the curriculum processing tools, and/or if you do not have prior experience with unifiedjs, we suggest you check out their guides before proceeding.

The process done on the curriculum by these packages can be summarized as:

parsing -> transforming -> compiling

The curriculum-parser-markdown and the curriculum-compiler folders have an index.sandbox.js file at their respective root levels who's purpose is to serve as a playground.

Checkout the individual packages for more details.

API

const {
  contentTypes
} = require('@enkidevs/curriculum-helpers')
const {
  getParser
} = require('@enkidevs/curriculum-parser-markdown')
const {
  getCompiler
} = require('@enkidevs/curriculum-compiler-string')

const parser = getParser(contentTypes.INSIGHT)
const ast = parser.parseSync('some markdown string')
const compiler = getCompiler(contentTypes.INSIGHT)
const markdownString = compiler.compileSync(ast)