proxy-generics-render

0.0.3 • Public • Published

proxy-generics-render

NPM version Build status Dependency Status Code Climate

Proxy Generic Render Service with Markdown-It. Converts markdown document with YAML to object with HTML and Metadata.

Looking for Proxy Engine? Looking for Proxy Generics?

Install

$ npm install --save proxy-generics-render

Configure

// config/proxyGenerics.js
module.exports = {
  // make the key render, alternatively make the key render_service to be the default render service
  render_service: {
    adapter: require('proxy-generic-render'),
    options: {
       // Must always be set to true
       html: true
    },
    plugins: [
     // Example Plugin (markdown-it-meta is required and already installed)
     // {
     //   plugin: require('markdown-it-meta'),
     //   options: {}
     // }
    ]
  }
}

Use

Create a markdown document

document.md

---
title: Hello World!
keywords: render service
runs: 0
score: 0.0
demographics:
 - {name: 'unknown'}
---
# Hello world!
 const document = fs.readFileSync('document.md', 'utf8')
 
 RenderGenericService.render(document)
  .then(doc => {
    // do something with doc
  })
  .catch(err => {
    // do something with error
  })

Dependencies (2)

Dev Dependencies (8)

Package Sidebar

Install

npm i proxy-generics-render

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • scottbwyatt
  • gpazo