Marko v3: Tests for resolving paths and templates

This commit is contained in:
Patrick Steele-Idem 2016-02-09 15:23:23 -07:00
parent b6d0dbcd7f
commit 5d2b43b88e
10 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1 @@
File: FOO!

View File

@ -0,0 +1,6 @@
var fs = require('fs');
module.exports = function(input, out) {
out.write('File: ' + fs.readFileSync(input.file, { encoding: 'utf8' }) );
};

View File

@ -0,0 +1 @@
FOO!

View File

@ -0,0 +1,6 @@
{
"<foo>": {
"renderer": "./foo-tag.js",
"@file": "path"
}
}

View File

@ -0,0 +1 @@
<foo file="./foo.txt"/>

View File

@ -0,0 +1 @@
Rendered template:[foo-template]

View File

@ -0,0 +1,4 @@
module.exports = function(input, out) {
out.write('Rendered template:');
input.template.render({}, out);
};

View File

@ -0,0 +1 @@
- [foo-template]

View File

@ -0,0 +1,6 @@
{
"<foo>": {
"renderer": "./foo-tag.js",
"@template": "template"
}
}

View File

@ -0,0 +1 @@
<foo template="./foo-template.marko"/>