Socket
Socket
Sign inDemoInstall

article-json-html-render

Package Overview
Dependencies
8
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    article-json-html-render

Base for html-based article-json renderer, such as [article-json-to-amp](https://www.npmjs.com/package/article-json-to-amp)


Version published
Weekly downloads
201
decreased by-23.57%
Maintainers
3
Install size
340 kB
Created
Weekly downloads
 

Readme

Source

article-json-html-render

Base for html-based article-json renderer, such as article-json-to-amp

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install article-json-html-render --save

Usage

import setupArticle from 'article-json-html-render';
import {element, string} from 'deku';

const items = [
  {type: 'paragraph', children: [{content: 'foo'}]},
  {type: 'embed', embedType: 'image', src: 'http://example.com/image.jpg'}
];

// Render into Deku component tree
const Article = setupArticle({
  embeds: {
    image: embed => <img src={embed.src} />
  }
});

console.log(string.render(<Article items={items} />));

// Render into html
const renderHtml = setupArticle.html();
console.log(renderHtml(items));

Tests

npm install
npm test

Dependencies

Dev Dependencies

License

MIT

Generated by package-json-to-readme

FAQs

Last updated on 03 Feb 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc