4.0.4 • Published 9 years ago
article-json-to-apple-news v4.0.4
article-json-to-apple-news
Render article json in Apple News format
Usage
npm install article-json-to-apple-newsconst convertToAppleNews = require('article-json-to-apple-news');
const article = {
title: 'Article Title',
author: {
name: 'John',
href: 'http://example.com/john'
},
publishedDate: new Date('2016-02-04T14:00:00Z'),
body: [
{
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(convertToAppleNews(article, { identifier: 'article-identifier' }));
// {
// article: <apple news article>,
// bundlesToUrls: <object that maps bundle:// urls to http(s) urls>
// }Body format
https://github.com/micnews/html-to-article-json#format
License
MIT
4.0.4
9 years ago
4.0.3
9 years ago
4.0.2
9 years ago
4.0.0
9 years ago
3.2.0
10 years ago
3.1.3
10 years ago
3.1.2
10 years ago
3.1.1
10 years ago
3.1.0
10 years ago
3.0.0
10 years ago
2.0.0
10 years ago
1.4.2
10 years ago
1.4.0
10 years ago
1.3.1
10 years ago
1.3.0
10 years ago
1.2.3
10 years ago
1.2.2
10 years ago
1.2.1
10 years ago
1.2.0
10 years ago
1.1.0
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.0.0
10 years ago