0.0.12 • Published 7 years ago

tm-content-generator v0.0.12

Weekly downloads
4
License
ISC
Repository
-
Last release
7 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

7 years ago

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago