tumblr-to-prosemirror
v1.1.4
Published
Convert tumblr blog entries to prosemirror format
Readme
tumblr-to-prosemirror
Convert tumblr blog entries to prosemirror format
Installation
npm install --save tumblr-to-prosemirrorUsage
var convert = require('tumblr-to-prosemirror');
convert({
host: 'vaffelfest.tumblr.com', // Some tumblr host. Just hostname, please.
apiKey: 'someApiKey',
json: false // Set to true if you want "plain old javascript objects" instead of actual ProseMirror `Node` instances.
}, function onConverted(err, posts) {
if (err) {
throw err;
}
console.log(posts);
});Each item in the resulting array passed to the callback contains two keys: tumblr and prosemirror.
tumblris the raw object returned by the tumblr APIprosemirroris the "body" field of the post parsed to either a ProseMirror node (default) or a JSON structure, ifjsonis set totruein the options. Note that thebodyfield is only actually used for text posts, and each post type seems to have it's own field containing the HTML.tumblr-to-prosemirrorwill try to resolve that field in the following order:bodycaptiontextdescription
License
MIT-licensed, see LICENSE
