Skip to content
/ distro Public

Transform article HTML for Facebook Instant Articles, Apple News and Google AMP

Notifications You must be signed in to change notification settings

micnews/distro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: {}
  }
}

API ENDPOINT

Distro is also available via API endpoint.

POST https://distro.mic.com/1.0/format

Post data:

Document HTML to transform

Query parameters:

output - one of apple-news, instant-article or amp. Return output for specified platform only. Optional.

LICENSE

MIT

About

Transform article HTML for Facebook Instant Articles, Apple News and Google AMP

Resources

Stars

Watchers

Forks

Packages

No packages published