Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

enkidevs/curriculum-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is deprecated. The parser is moved to https://github.com/enkidevs/curriculum-processors

Enki Curriculum Parser

Resources

API

const {
  types,
  getParser
} = require('@enkidevs/curriculum-parser')

const parser = getParser(types.INSIGHT)

const ast = parser.parseSync('some markdown string') // or vfile(/path/to/markdown-file)

const markdownString = parser.stringifySync(ast)  // we get back the markdown string

Usage

const {
  types, getProcessor
} = require('@enkidevs/curriculum-parser');

const remark2rehype = require('remark-rehype');
const doc = require('rehype-document');
const format = require('rehype-format');
const html = require('rehype-stringify');
var vfile = require('to-vfile');
var report = require('vfile-reporter');

getProcessor(types.INSIGHT)
  .use(remark2rehype)
  .use(doc, { title: 'Insight' })
  .use(format)
  .use(html)
  .process(vfile.readSync('insight.md'), function (err, file) {
    console.error(report(err || file));
    console.log(String(file));
  });

Releases

No releases published

Packages

No packages published