Closed ansydor closed 7 years ago
Well that is actually supported but not properly documented.
const ejs = new EmbedJS(options, template)
Here template is an object containing the render methods just like https://github.com/ritz078/embed.js/blob/master/src/js/modules/template.js
But I see there is an error in https://github.com/ritz078/embed.js/blob/master/src/js/main.js#L163
instead of
this.options.template = template || renderer;
it should actually extend
this.options.template = deepExtend(renderer, template);
Here renderer
is the default template object and its should merge with template
.
Would you like to send a PR ? Or else I will do it when there's time.
In general, embeds renders with fixed layout.
But It's good to have an ability to change it. Maybe to set a template to render with. Maybe some event where URL comes and render html can be changed. Like: