Loading lib/patternlibrary.js +6 −4 Original line number Diff line number Diff line Loading @@ -96,7 +96,8 @@ class Patternlibrary { /** * Retrieves (handlebars) page template * * if no layout is set yet, returns the default layout template * if no page template is set yet, returns the default * gui doc-page template * * @function layout * @param {object} data - template data Loading @@ -112,10 +113,11 @@ class Patternlibrary { /** * Sets and compiles (handlebars) page by page filename * * if no name is given an 'empty' layout ('{{> body}}') is set * if `page` is a '.md' or '.markdown' file, it is also * passed through the markdown renderer * * @param {string} layoutname - the file basename of the layoutfile * @var {function} layout - a precompiled (handlebars) template * @param {string} page - the file basename of the page-file * @var {function} pagetemplate - a precompiled (handlebars) template */ set pagetemplate ( page ) { Loading test/test.00.patternlibrary.js +19 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,25 @@ describe('Patternlibrary instanciation and configuration:', function() { }); describe('Patternlibrary.init()', function() { it('should contain no \'handlebars\' instance before first execution', function () { expect(Patternlibrary.handlebars).to.be.undefined; }); it('should contain no \'markdowm-it\' instance before first execution', function () { expect(Patternlibrary.markdown).to.be.undefined; }); it('should contain a \'handlebars\' instance after instanciation', function () { var p = new Patternlibrary.Patternlibrary(); expect(p.handlebars).not.to.be.undefined; expect(p.handlebars).to.be.a('object'); }); it('should contain a \'markdowm-it\' instance after instanciation', function () { var p = new Patternlibrary.Patternlibrary(); expect(p.markdown).not.to.be.undefined; expect(p.markdown).to.be.a('object'); }); }); describe('Patternlibrary.adapter()', function() { it('loads built-in adapters', function() { var p = new Patternlibrary.Patternlibrary(); Loading Loading
lib/patternlibrary.js +6 −4 Original line number Diff line number Diff line Loading @@ -96,7 +96,8 @@ class Patternlibrary { /** * Retrieves (handlebars) page template * * if no layout is set yet, returns the default layout template * if no page template is set yet, returns the default * gui doc-page template * * @function layout * @param {object} data - template data Loading @@ -112,10 +113,11 @@ class Patternlibrary { /** * Sets and compiles (handlebars) page by page filename * * if no name is given an 'empty' layout ('{{> body}}') is set * if `page` is a '.md' or '.markdown' file, it is also * passed through the markdown renderer * * @param {string} layoutname - the file basename of the layoutfile * @var {function} layout - a precompiled (handlebars) template * @param {string} page - the file basename of the page-file * @var {function} pagetemplate - a precompiled (handlebars) template */ set pagetemplate ( page ) { Loading
test/test.00.patternlibrary.js +19 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,25 @@ describe('Patternlibrary instanciation and configuration:', function() { }); describe('Patternlibrary.init()', function() { it('should contain no \'handlebars\' instance before first execution', function () { expect(Patternlibrary.handlebars).to.be.undefined; }); it('should contain no \'markdowm-it\' instance before first execution', function () { expect(Patternlibrary.markdown).to.be.undefined; }); it('should contain a \'handlebars\' instance after instanciation', function () { var p = new Patternlibrary.Patternlibrary(); expect(p.handlebars).not.to.be.undefined; expect(p.handlebars).to.be.a('object'); }); it('should contain a \'markdowm-it\' instance after instanciation', function () { var p = new Patternlibrary.Patternlibrary(); expect(p.markdown).not.to.be.undefined; expect(p.markdown).to.be.a('object'); }); }); describe('Patternlibrary.adapter()', function() { it('loads built-in adapters', function() { var p = new Patternlibrary.Patternlibrary(); Loading