diff --git a/test/fixtures/render/autotest/syntax-concise/expected.html b/test/fixtures/render/autotest/syntax-concise/expected.html new file mode 100644 index 000000000..a5d9f5257 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/expected.html @@ -0,0 +1,4 @@ + Marko Templating Engine

Marko Templating Engine

Marko is a fast and lightweight templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. It supports both a familiar HTML syntax and a concise, indentation-based syntax.

No colors!
Body content for Tab 1
Body content for Tab 2
\ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/marko.json b/test/fixtures/render/autotest/syntax-concise/marko.json new file mode 100644 index 000000000..7ecc75f05 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/marko.json @@ -0,0 +1,3 @@ +{ + "": "./tabs/marko-tag.json" +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/tabs/marko-tag.json b/test/fixtures/render/autotest/syntax-concise/tabs/marko-tag.json new file mode 100644 index 000000000..39d0e5fd9 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/tabs/marko-tag.json @@ -0,0 +1,7 @@ +{ + "renderer": "./renderer", + "@orientation": "string", + "@tabs []": { + "@title": "string" + } +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/tabs/renderer.js b/test/fixtures/render/autotest/syntax-concise/tabs/renderer.js new file mode 100644 index 000000000..c84483a98 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/tabs/renderer.js @@ -0,0 +1,9 @@ +var template =require('./template.marko'); + +exports.renderer = function(input, out) { + var tabs = input.tabs; + + template.render({ + tabs: tabs + }, out); +}; \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/tabs/template.marko b/test/fixtures/render/autotest/syntax-concise/tabs/template.marko new file mode 100644 index 000000000..0fd426ed6 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/tabs/template.marko @@ -0,0 +1,14 @@ + + +
+
    +
  • + ${tab.title} +
  • +
+
+
+ +
+
+
\ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/template.marko b/test/fixtures/render/autotest/syntax-concise/template.marko new file mode 100644 index 000000000..53a778f22 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/template.marko @@ -0,0 +1,48 @@ +var pageTitle="Marko Templating Engine" +var currentPage='home' + + +html lang="en" + head + title - ${pageTitle} + body + h1 - ${pageTitle} + + p + --- + Marko is a fast and lightweight templating engine that + compiles templates to CommonJS modules and supports streaming, + async rendering and custom tags. It supports both a familiar + HTML syntax and a concise, indentation-based syntax. + --- + + ul.features + li for(feature in ['async', 'streaming', 'custom-tags', 'readable', 'modules']) + ${feature} + + ul if(notEmpty(data.colors)) + li for(color in data.colors) - ${color} + div else + - No colors! + + tabs + tabs:tab title="Tab 1" + - Body content for Tab 1 + tabs:tab title="Tab 2" + - Body content for Tab 2 + + script type='text/javascript' + --- + if (foo) { + alert('Marko is awesome!'); + } + --- + + macro navLink(id, href, title) + li + a.nav-link class=(id === currentPage && 'active') href=href - ${title} + + ul + navLink('home', '/', 'Home') + navLink('docs', '/docs', 'Docs') + navLink('blog', '/blog', 'Blog') \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-concise/test.js b/test/fixtures/render/autotest/syntax-concise/test.js new file mode 100644 index 000000000..c4013b344 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-concise/test.js @@ -0,0 +1 @@ +exports.templateData = {}; diff --git a/test/fixtures/render/autotest/syntax-mixed/expected.html b/test/fixtures/render/autotest/syntax-mixed/expected.html new file mode 100644 index 000000000..546474b3c --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/expected.html @@ -0,0 +1,5 @@ + Marko Templating Engine

Marko Templating Engine

Marko is a fast and lightweight templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. It supports both a familiar HTML syntax and a concise, indentation-based syntax.

  • async
  • streaming
  • custom-tags
  • readable
  • modules
No colors!
  • Tab 1
  • Tab 2
Body content for Tab 1
Body content for Tab 2
\ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/marko.json b/test/fixtures/render/autotest/syntax-mixed/marko.json new file mode 100644 index 000000000..7ecc75f05 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/marko.json @@ -0,0 +1,3 @@ +{ + "": "./tabs/marko-tag.json" +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/tabs/marko-tag.json b/test/fixtures/render/autotest/syntax-mixed/tabs/marko-tag.json new file mode 100644 index 000000000..39d0e5fd9 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/tabs/marko-tag.json @@ -0,0 +1,7 @@ +{ + "renderer": "./renderer", + "@orientation": "string", + "@tabs []": { + "@title": "string" + } +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/tabs/renderer.js b/test/fixtures/render/autotest/syntax-mixed/tabs/renderer.js new file mode 100644 index 000000000..c84483a98 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/tabs/renderer.js @@ -0,0 +1,9 @@ +var template =require('./template.marko'); + +exports.renderer = function(input, out) { + var tabs = input.tabs; + + template.render({ + tabs: tabs + }, out); +}; \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/tabs/template.marko b/test/fixtures/render/autotest/syntax-mixed/tabs/template.marko new file mode 100644 index 000000000..0fd426ed6 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/tabs/template.marko @@ -0,0 +1,14 @@ + + +
+
    +
  • + ${tab.title} +
  • +
+
+
+ +
+
+
\ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/template.marko b/test/fixtures/render/autotest/syntax-mixed/template.marko new file mode 100644 index 000000000..c2df3c548 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/template.marko @@ -0,0 +1,52 @@ + + + + +html lang="en" + head + title - ${pageTitle} + body + h1 - ${pageTitle} + + p + --- + Marko is a fast and lightweight templating engine that + compiles templates to CommonJS modules and supports streaming, + async rendering and custom tags. It supports both a familiar + HTML syntax and a concise, indentation-based syntax. + --- + + ul.features + li for(feature in ['async', 'streaming', 'custom-tags', 'readable', 'modules']) + ${feature} + + ul if(notEmpty(data.colors)) + li for(color in data.colors) - ${color} + div else + - No colors! + + tabs + tabs:tab title="Tab 1" + - Body content for Tab 1 + tabs:tab title="Tab 2" + - Body content for Tab 2 + + + + +
  • + + ${title} + +
  • +
    + +
      + + + +
    \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-mixed/test.js b/test/fixtures/render/autotest/syntax-mixed/test.js new file mode 100644 index 000000000..c4013b344 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-mixed/test.js @@ -0,0 +1 @@ +exports.templateData = {}; diff --git a/test/fixtures/render/autotest/syntax-verbose/expected.html b/test/fixtures/render/autotest/syntax-verbose/expected.html new file mode 100644 index 000000000..546474b3c --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/expected.html @@ -0,0 +1,5 @@ + Marko Templating Engine

    Marko Templating Engine

    Marko is a fast and lightweight templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. It supports both a familiar HTML syntax and a concise, indentation-based syntax.

    • async
    • streaming
    • custom-tags
    • readable
    • modules
    No colors!
    • Tab 1
    • Tab 2
    Body content for Tab 1
    Body content for Tab 2
    \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/marko.json b/test/fixtures/render/autotest/syntax-verbose/marko.json new file mode 100644 index 000000000..7ecc75f05 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/marko.json @@ -0,0 +1,3 @@ +{ + "": "./tabs/marko-tag.json" +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/tabs/marko-tag.json b/test/fixtures/render/autotest/syntax-verbose/tabs/marko-tag.json new file mode 100644 index 000000000..39d0e5fd9 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/tabs/marko-tag.json @@ -0,0 +1,7 @@ +{ + "renderer": "./renderer", + "@orientation": "string", + "@tabs []": { + "@title": "string" + } +} \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/tabs/renderer.js b/test/fixtures/render/autotest/syntax-verbose/tabs/renderer.js new file mode 100644 index 000000000..c84483a98 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/tabs/renderer.js @@ -0,0 +1,9 @@ +var template =require('./template.marko'); + +exports.renderer = function(input, out) { + var tabs = input.tabs; + + template.render({ + tabs: tabs + }, out); +}; \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/tabs/template.marko b/test/fixtures/render/autotest/syntax-verbose/tabs/template.marko new file mode 100644 index 000000000..0fd426ed6 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/tabs/template.marko @@ -0,0 +1,14 @@ + + +
    +
      +
    • + ${tab.title} +
    • +
    +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/template.marko b/test/fixtures/render/autotest/syntax-verbose/template.marko new file mode 100644 index 000000000..11eadc515 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/template.marko @@ -0,0 +1,61 @@ + + + + + + + ${pageTitle} + + +

    ${pageTitle}

    + +

    + Marko is a fast and lightweight templating engine that + compiles templates to CommonJS modules and supports streaming, + async rendering and custom tags. It supports both a familiar + HTML syntax and a concise, indentation-based syntax. +

    + + +
  • + ${feature} +
  • + + +
      +
    • ${color}
    • +
    +
    + No colors! +
    + + + + Body content for Tab 1 + + + Body content for Tab 2 + + + + + + +
  • + + ${title} + +
  • +
    + +
      + + + +
    + + \ No newline at end of file diff --git a/test/fixtures/render/autotest/syntax-verbose/test.js b/test/fixtures/render/autotest/syntax-verbose/test.js new file mode 100644 index 000000000..c4013b344 --- /dev/null +++ b/test/fixtures/render/autotest/syntax-verbose/test.js @@ -0,0 +1 @@ +exports.templateData = {};