@mattersmedia/article-json-to-fbia

1.8.0 • Public • Published

article-json-to-fbia

Render article json in Facebook Instant Article Format

Build Status

Usage

npm install article-json-to-fbia
const convertToFbia = require('article-json-to-fbia');
const articleJson = [
  {
    type: 'paragraph',
    children: [
      {
        type: 'text',
        content: 'This is the text and '
      },
      {
        type: 'text',
        bold: true,
        content: 'some bold text '
      },
      {
        type: 'text',
        href: 'http://example.com',
        content: 'some link'
      }
    ]
  },
  {
    type: 'embed',
    embedType: 'image',
    src: 'http://example/image.jpg',
    width: 300,
    height: 150
  }
]
;

console.log(convertToFbia(articleJson));

Body format

https://github.com/micnews/html-to-article-json#format

License

MIT

Package Sidebar

Install

npm i @mattersmedia/article-json-to-fbia

Weekly Downloads

121

Version

1.8.0

License

MIT

Unpacked Size

26.8 kB

Total Files

9

Last publish

Collaborators

  • mparkerdfy
  • johnomarkid
  • tom-james-watson