Skip to content

Instantly share code, notes, and snippets.

@apla
Created May 27, 2014 08:47
Show Gist options
  • Save apla/99ea2ef8f8704733ff69 to your computer and use it in GitHub Desktop.
Save apla/99ea2ef8f8704733ff69 to your computer and use it in GitHub Desktop.
dataflows example
[{
"path": "post",
"tasks": [{}]
}, {
"path": "upload"
}, {
"path": "presenters",
"flows": [{
"path": "json",
"data": {
"title": "title for presenter",
"description": "description for presenter"
},
"presenter": {
"type": "json",
"dump": true
}
}, {
"path": "ejs",
"data": {
"title": "title for presenter",
"description": "description for presenter"
},
"presenter": {
"file": "index.ejs",
"vars":{
"type": "ejs",
"title": "{$title}",
"description": "{$description}",
"note": "all those keys must be declared or you must EXPLICITLY declare `dump` option"
}
},
"note" : "presenter type assumed from file extension",
"note2": "presenter file location relative to the share/presentation within project root",
"note3": "or defined in project config key `templateDir`"
}, {
"path": "hogan",
"data": {
"title": "title for presenter",
"description": "description for presenter"
},
"presenter": {
"file": "index.hogan",
"vars":{
"type": "hogan",
"title": "{$title}",
"description": "{$description}"
}
}
}, {
"path": "handlebars",
"data": {
"title": "title for presenter",
"description": "description for presenter"
},
"presenter": {
"file": "index.handlebars",
"vars":{
"type": "handlebars",
"title": "{$title}",
"description": "{$description}"
}
}
}]
}]
<h1> <%= title %> </h1>
<p> <%= description %> <strong><%= type %></strong></p>
<h1> {{title}} </h1>
<p> {{description}} <strong>{{type}}</strong></p>
<h1> {{title}} </h1>
<p> {{description}} <strong>{{type}}</strong></p>
@apla
Copy link
Author

apla commented May 27, 2014

to get it working, add such snippet

{
                "path": "example",
                "flows": "<example.json>"
            }

into flows section of http initiator within project config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment