Skip to content
Generate localized texts with configurable parts for maxdome assets, maxperts and reviews
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
locales
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

Usage

Simplest usage, only the asset title

const renderer = require('ai-renderer-maxdome');

const string = renderer({ asset }, ['title']);
// "Criminal Minds: Beyond Borders"

Advanced usage, tip of the day with maxpert, typed title, genres and review

const renderer = require('ai-renderer-maxdome');

const string = renderer({ asset }, ['tipOfTheDay', 'typedTitle']);
// "Tipp des Tages: Die Serie Criminal Minds: Beyond Borders"

Advanced usage, tip of the day with maxpert, typed title, genres and review

const renderer = require('ai-renderer-maxdome');

const string = renderer({ asset, maxpert, review }, ['tipOfTheDay', 'maxpert', 'typedTitle', 'review']);
// "Tipp des Tages von Felix Böhme: Die Serie Criminal Minds: Beyond Borders, Weltweit den Tätern auf der Spur"

Documentation

renderer(data, parts)

data

Object with the available data for the output (asset, maxpert, review).

  • Component structure (asset and maxpert as part of review)
const data = { 
  review: { 
    ...,
    asset: { ... }, 
    maxpert: { ... }, 
  }, 
};
  • Separated structure
const data = { 
  asset: { ... }, 
  maxpert: { ... }, 
  review: { ... }, 
};

parts

Array with the enabled parts for the output. The order in the array doesn't influence the output.

  • description: Description of the asset, if combined with other parts, it will be added at the end
  • title: Title, e.g. "Criminal Minds: Beyond Borders"
  • typedTitle: Title prefixed with the type, e.g. "Die Serie Criminal Minds: Beyond Borders"
  • genres: Comma separated genres, e.g. ", Genres: Drama, Thriller"
  • tipOfTheDay: Prefix for the tip of the day, e.g. "Tipp des Tages: " or if maxpert is enabled "Tipp des Tages von ${maxpert}"
  • maxpert: Firstname and surname of the maxpert (only available with tipOfTheDay together), e.g. "Felix Böhme"
  • review: The headline of the review, e.g. ", Weltweit den Tätern auf der Spur"
You can’t perform that action at this time.