markdown-article-format

1.0.12 • Public • Published

markdown-article-format

Transform markdown articles to HTML, AMP, FB Instant Articles, Apple News Format, and Mic's article-json format

⚠️ Work In Progress!

This library is under heavy early development. We don't recommend using it just yet. Check back here for updates!


Installation

yarn add markdown-article-format

Usage

markdown -> html

import { markdownToHtml } from 'markdown-article-format';

const html = markdownToHtml(`
  # Example
  This is an example.
`);

markdown -> amp

import { markdownToAmp } from 'markdown-article-format';

const amp = markdownToAmp(`
  # Example
  This is an example.
`);

markdown -> appleNews

import { markdownToAppleNews } from 'markdown-article-format';

const appleNews = markdownToAppleNews(`
  # Example
  This is an example.
`, {
  title: 'Example',
  subtitle: 'Just an example',
  authorName: 'Dan Scanlon', // optional
  authorLink: 'https://github.com/danscan', // optional
  // featuredImage, // TODO: Use this
  canonicalUrl: 'https://github.com/futurism-core/markdown-article-format',
  slug: 'markdown-article-format',
  tags: ['markdown', 'formatting', 'apple news'],
  publishedDate: new Date(),
  updatedDate: new Date(),
  // apple news document styling options (optional)
  // layout,
  // componentLayouts,
  // componentTextStyles,
  // componentStyles,
  // textStyles,
});

Dependencies (6)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i markdown-article-format

    Weekly Downloads

    0

    Version

    1.0.12

    License

    MIT

    Unpacked Size

    27.6 kB

    Total Files

    9

    Last publish

    Collaborators

    • futurism