Socket
Book a DemoInstallSign in
Socket

@fabrix/generics-render

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fabrix/generics-render

Generic: Render markdown with YAML as HTML and Metadata

latest
Source
npmnpm
Version
1.5.0
Version published
Maintainers
1
Created
Source

generics-render

Gitter NPM version Build Status Test Coverage Dependency Status Follow @FabrixApp on Twitter

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

Looking for Generics?

Install

$ npm install --save @fabrix/generics-render

Configure

// config/generics.js
export const generics = {
  // make the key render, alternatively make the key render_service to be the default render service
  render_service: {
    adapter: require('@fabrix/generic-render').RenderGeneric,
    config: {
       // 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
  })

Keywords

engine

FAQs

Package last updated on 08 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts