distro-mic
v1.0.0
Published
Automatically transform article HTML for third-party platforms such as Facebook Instant Articles, Apple News and Google AMP
Downloads
8
Readme
Distro.Mic
Transform article HTML for Facebook Instant Articles, Apple News and Google AMP.
Note, this module is designed to transform article body only, other elements of the article page like header, byline and custom stylesheets should be added separately for each format.
USAGE
Install using npm:
npm install distro-mic
var format = require('distro-mic').format;
var html = '<p>Article HTML</p>'
var output = format(html);
Output:
{
amp: '<article><p>Article HTML</p></article>',
instantArticle: '<article><p>Article HTML</p></article>',
appleNews: {
article: [{
text: 'Article HTML\n',
additions: [],
inlineTextStyles: [],
role: 'body',
layout: 'bodyLayout'
}],
bundlesToUrls: {}
}
}
LICENSE
MIT