@tryghost/mg-html-mobiledoc

0.9.25 • Public • Published

Migrate HTML -> Mobiledoc

A little wrapper tool for migrating all HTML fields of posts to mobiledoc

Install

npm install @tryghost/mg-html-mobiledoc --save

or

yarn add @tryghost/mg-html-mobiledoc

Usage

  var mgHtmlMobiledoc = require('tryghost/mg-html-mobiledoc');
  var convertedData = mgHtmlMobiledoc.convert(myData);

Data structure passed in can be either

var myData = {
    logger: yourLoggingInstance,
    posts: [
        {
            html: '<h2>Good stuff here</h2>'
        }
    ]
}

or

var myData = {
    logger: yourLoggingInstance,
    data: {
        posts: [
            {
                html: '<h2>Good stuff here</h2>'
            }
        ]
    }
}

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

  • yarn dev

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @tryghost/mg-html-mobiledoc

Weekly Downloads

102

Version

0.9.25

License

MIT

Unpacked Size

6.34 kB

Total Files

7

Last publish

Collaborators

  • ryan_feigenbaum
  • erik-ghost
  • dvdwinden
  • vershwal
  • 9larsons
  • mike182uk
  • sagzy
  • chrisraible
  • jonhickman
  • kernalghost
  • hadret
  • minimaluminium
  • ronaldlangeveld
  • joeegrigg
  • sanne-san
  • djordjevlais
  • bobvaneck
  • zimoatghost
  • allouis
  • gargol
  • erisds
  • johnonolan
  • kevinansfield
  • cobbspur
  • aileencgn
  • jloh
  • daniellockyer
  • sam-lord
  • pauladamdavis