tm-content-generator

0.0.12 • Public • Published

TM Content Generator

A content generator to be used in conjunction with Pravda

Build Status codecov

This is a content generator to be used with PRAVDA, which is a GraphQL API that interfaces with the Escenic's WebService.

Example usage

Below is a non-ES6 example that generates a news article:

'use strict';

var ContentGenerator = require('tm-content-generator').default;
var contentGenerator = new ContentGenerator();

// generate an article with only 1 picture inline relation and 1 html inline relation
var articleMeta = contentGenerator.generateArticle(
    { sectionId: 70, publication: 'mirror' },
    { picture: [1,2,3], html: [4,5] },
    { pictureRel: [], teaserRel: [], inlineRelations: ['picture','html'] },
    { min: 1, max: 1 }
);

Below is an ES6+ example that generates a news article:

import ContentGenerator from 'tm-content-generator';
const contentGenerator = ContentGenerator();

// generate an article with only 1 picture inline relation and 1 html inline relation
const articleMeta = contentGenerator.generateArticle(
    { sectionId: 70, publication: 'mirror' },
    { picture: [1,2,3], html: [4,5] },
    { pictureRel: [], teaserRel: [], inlineRelations: ['picture','html'] },
    { min: 1, max: 1 }
);

Readme

Keywords

none

Package Sidebar

Install

npm i tm-content-generator

Weekly Downloads

1

Version

0.0.12

License

ISC

Unpacked Size

3.77 MB

Total Files

55

Last publish

Collaborators

  • robertstettner
  • svozza
  • trinitymirrordigital-admin
  • ttollers
  • jeffdownie
  • samwhite
  • nygel
  • attila-m