Loading gui/src/layouts/default.html +19 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,24 @@ </div> </section> <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setCookieDomain", "*.demo.patternlibrary.bjoernbartels.earth"]); _paq.push(["setDomains", ["*.demo.patternlibrary.bjoernbartels.earth","*.demo.patternlibrary.net","*.demo.patternlibrary.org"]]); _paq.push(["enableCrossDomainLinking"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//analytics.bjoernbartels.earth/piwik/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '7']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//analytics.bjoernbartels.earth/piwik/piwik.php?idsite=7&rec=1" style="border:0;" alt="" /></p></noscript> <!-- End Matomo Code --> </body> </html> No newline at end of file lib/adapters/gitinfo.js +11 −10 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ module.exports.search = function(items, link) { function getGitInfo(value, config, pl) { if (!fs.existsSync(value)) return false; var logFormatYaml = '- date: \'%cd\''+'%n'+ ' timestamp: %ct'+'%n'+ Loading Loading @@ -88,7 +88,7 @@ function getGitInfo(value, config, pl) { function processTree(tree, config) { var logs = {}; if (tree && tree.log) { for (var i in tree.log.data) { var obj = tree.log.data[i]; var logdate = obj.date; Loading @@ -97,6 +97,7 @@ function processTree(tree, config) { logs[logdate].push(obj); } tree.log.data = logs; } return tree; } Loading lib/adapters/tests.js +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module.exports.search = function(items, link) { function getPatternSpecs(value, config, pl) { if (!fs.existsSync(value)) return false; var sourceFile = frontMatter(fs.readFileSync(value).toString()); //var sourceFile = frontMatter(fs.readFileSync(value).toString()); return {}; } Loading test/fixtures/adapters/example/partials/atoms/link/test.js 0 → 100644 +0 −0 Empty file added. test/test.20.adapter.js +120 −4 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ describe('Patternlibrary instanciation and configuration:', function() { describe('Patternlibrary "example" adapter:', () => { let adapter = require('../lib/adapters/example.js'); let patternlibraryOptions = { /*let patternlibraryOptions = { verbose : false, dest : FIXTURES + 'example/build', root : FIXTURES + 'example/pages/', Loading @@ -142,7 +142,8 @@ describe('Patternlibrary instanciation and configuration:', function() { partials: FIXTURES + 'example/partials/', testing : true }; var p = new Patternlibrary.Patternlibrary(patternlibraryOptions); var p = new Patternlibrary.Patternlibrary(patternlibraryOptions);*/ var p = new Patternlibrary.Patternlibrary(); it('retrieves example\'s source-code from file', function (done) { Loading Loading @@ -241,7 +242,6 @@ describe('Patternlibrary instanciation and configuration:', function() { 'test/fixtures/adapters/example/partials/atoms/link/module.js', {}, ( a, b ) => { console.log(b); expect(b).to.be.an('object') .that.is.not.empty; Loading Loading @@ -272,7 +272,6 @@ describe('Patternlibrary instanciation and configuration:', function() { 'test/fixtures/adapters/example/partials/atoms/link/module_no_defaults.js', {}, ( a, b ) => { console.log(b); expect(b).to.be.an('object') .that.is.not.empty; Loading @@ -283,6 +282,123 @@ describe('Patternlibrary instanciation and configuration:', function() { ); }); }); describe('Patternlibrary "changelog" adapter:', () => { let adapter = require('../lib/adapters/changelog.js'); var p = new Patternlibrary.Patternlibrary(); it('retrieves example\'s source-code from file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/changelog.md', {}, ( a, b ) => { expect(b).to.be.a('string'); done(); }, p ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/changelog_not_found.md', {}, ( a, b ) => { expect(b).to.equal(false); done(); }, p ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); describe('Patternlibrary "tests" adapter:', () => { let adapter = require('../lib/adapters/tests.js'); it('retrieves test-results from test-file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/test.js', {}, ( a, b ) => { expect(b).to.be.a('object'); done(); } ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/test_not_found.js', {}, ( a, b ) => { expect(b).to.equal(false); done(); } ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); describe('Patternlibrary "gitinfo" adapter:', () => { let adapter = require('../lib/adapters/gitinfo.js'); var p = new Patternlibrary.Patternlibrary(); it('retrieves git-info from file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/atom-link.html', {}, ( a, b ) => { expect(b).to.be.a('object'); done(); }, p ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/file_not_found.html', {}, ( a, b ) => { expect(b).to.equal(false); done(); }, p ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); Loading Loading
gui/src/layouts/default.html +19 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,24 @@ </div> </section> <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setCookieDomain", "*.demo.patternlibrary.bjoernbartels.earth"]); _paq.push(["setDomains", ["*.demo.patternlibrary.bjoernbartels.earth","*.demo.patternlibrary.net","*.demo.patternlibrary.org"]]); _paq.push(["enableCrossDomainLinking"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//analytics.bjoernbartels.earth/piwik/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '7']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//analytics.bjoernbartels.earth/piwik/piwik.php?idsite=7&rec=1" style="border:0;" alt="" /></p></noscript> <!-- End Matomo Code --> </body> </html> No newline at end of file
lib/adapters/gitinfo.js +11 −10 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ module.exports.search = function(items, link) { function getGitInfo(value, config, pl) { if (!fs.existsSync(value)) return false; var logFormatYaml = '- date: \'%cd\''+'%n'+ ' timestamp: %ct'+'%n'+ Loading Loading @@ -88,7 +88,7 @@ function getGitInfo(value, config, pl) { function processTree(tree, config) { var logs = {}; if (tree && tree.log) { for (var i in tree.log.data) { var obj = tree.log.data[i]; var logdate = obj.date; Loading @@ -97,6 +97,7 @@ function processTree(tree, config) { logs[logdate].push(obj); } tree.log.data = logs; } return tree; } Loading
lib/adapters/tests.js +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module.exports.search = function(items, link) { function getPatternSpecs(value, config, pl) { if (!fs.existsSync(value)) return false; var sourceFile = frontMatter(fs.readFileSync(value).toString()); //var sourceFile = frontMatter(fs.readFileSync(value).toString()); return {}; } Loading
test/test.20.adapter.js +120 −4 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ describe('Patternlibrary instanciation and configuration:', function() { describe('Patternlibrary "example" adapter:', () => { let adapter = require('../lib/adapters/example.js'); let patternlibraryOptions = { /*let patternlibraryOptions = { verbose : false, dest : FIXTURES + 'example/build', root : FIXTURES + 'example/pages/', Loading @@ -142,7 +142,8 @@ describe('Patternlibrary instanciation and configuration:', function() { partials: FIXTURES + 'example/partials/', testing : true }; var p = new Patternlibrary.Patternlibrary(patternlibraryOptions); var p = new Patternlibrary.Patternlibrary(patternlibraryOptions);*/ var p = new Patternlibrary.Patternlibrary(); it('retrieves example\'s source-code from file', function (done) { Loading Loading @@ -241,7 +242,6 @@ describe('Patternlibrary instanciation and configuration:', function() { 'test/fixtures/adapters/example/partials/atoms/link/module.js', {}, ( a, b ) => { console.log(b); expect(b).to.be.an('object') .that.is.not.empty; Loading Loading @@ -272,7 +272,6 @@ describe('Patternlibrary instanciation and configuration:', function() { 'test/fixtures/adapters/example/partials/atoms/link/module_no_defaults.js', {}, ( a, b ) => { console.log(b); expect(b).to.be.an('object') .that.is.not.empty; Loading @@ -283,6 +282,123 @@ describe('Patternlibrary instanciation and configuration:', function() { ); }); }); describe('Patternlibrary "changelog" adapter:', () => { let adapter = require('../lib/adapters/changelog.js'); var p = new Patternlibrary.Patternlibrary(); it('retrieves example\'s source-code from file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/changelog.md', {}, ( a, b ) => { expect(b).to.be.a('string'); done(); }, p ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/changelog_not_found.md', {}, ( a, b ) => { expect(b).to.equal(false); done(); }, p ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); describe('Patternlibrary "tests" adapter:', () => { let adapter = require('../lib/adapters/tests.js'); it('retrieves test-results from test-file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/test.js', {}, ( a, b ) => { expect(b).to.be.a('object'); done(); } ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/test_not_found.js', {}, ( a, b ) => { expect(b).to.equal(false); done(); } ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); describe('Patternlibrary "gitinfo" adapter:', () => { let adapter = require('../lib/adapters/gitinfo.js'); var p = new Patternlibrary.Patternlibrary(); it('retrieves git-info from file', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/atom-link.html', {}, ( a, b ) => { expect(b).to.be.a('object'); done(); }, p ); }); it('returns flase if file is not readable/does not exist', function (done) { adapter( 'test/fixtures/adapters/example/partials/atoms/link/file_not_found.html', {}, ( a, b ) => { expect(b).to.equal(false); done(); }, p ); }); it('search method returns empty result', function () { let result = adapter.search(); expect(result).to.be.empty; }); }); Loading