0.0.12 • Published 5 years ago

tm-content-generator v0.0.12

Weekly downloads
4
License
ISC
Repository
-
Last release
5 years ago

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 }
);
0.0.12

5 years ago

0.0.11

7 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago