Closed briandk closed 9 years ago
The next steps are:
This one should be easy. Using the test object, grab the live-preview area and inject the template output into it.
var livePreview = $('#live-preview')
var testTranscript = Handlebars.templates.transcriptTemplate(getTestTranscript());
livePreview.html(testTranscript);
This will be less easy, so it'll take some thinking. I'm wondering if having default object constructors might be helpful. Perhaps we could turn the current transdown-specification.js
into a file with a namespace. That namespaces properties would be the hierarchy of the transdown object, except they'd be functions that return empty/default instances of the object specs.
Or, I guess, we could just hand the object specs to the constructor method. See Crockford (p.144 and thereabouts) on handling a situation where we pass in a spec
object to specify common properties. Specifically, note how he uses the OR ||
so that if a property isn't defined in the spec, he can define it there. That can be a good pattern for episode titles, perhaps.
var cat = function (spec) {
spec.saying = spec.saying || 'meow';
var that = mammal(spec);”
The aim of this pull request is to define a handlebars.js template for transcript output.
Part of my idea is that with a single template, we can put that template in multiple places on the site. Then, the workflow for redeploying style changes to the template is:
.handlebars
file