distro

所属分类:Python编程
开发工具:HTML
文件大小:0KB
下载次数:0
上传日期:2017-04-20 23:03:39
上 传 者sh-1993
说明:  转换Facebook即时文章、苹果新闻和谷歌AMP的文章HTML
(Transform article HTML for Facebook Instant Articles, Apple News and Google AMP)

文件列表:
.babelrc (28, 2016-09-18)
.npmignore (0, 2016-09-18)
lib/ (0, 2016-09-18)
lib/index.js (828, 2016-09-18)
package.json (1104, 2016-09-18)
test/ (0, 2016-09-18)
test/article.amp.html (1719, 2016-09-18)
test/article.apple-news.json (2735, 2016-09-18)
test/article.html (1984, 2016-09-18)
test/article.instant-article.html (1697, 2016-09-18)
test/index.js (1618, 2016-09-18)

# Distro.Mic Transform article HTML for [Facebook Instant Articles](https://developers.facebook.com/docs/instant-articles), [Apple News](https://developer.apple.com/library/ios/documentation/General/Conceptual/Apple_News_Format_Ref/AppleNewsFormat.html) and [Google AMP](https://www.ampproject.org/docs/get_started/about-amp.html). 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: ```bash npm install distro-mic ``` ```js var format = require('distro-mic').format; var html = '

Article HTML

' var output = format(html); ``` Output: ```js { amp: '

Article HTML

', instantArticle: '

Article HTML

', 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

近期下载者

相关文件


收藏者