Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding examples! #577

Merged
merged 1 commit into from Mar 24, 2015
Merged

Adding examples! #577

merged 1 commit into from Mar 24, 2015

Conversation

sethkinast
Copy link
Contributor

Simple browser
AMD in the browser
Super-simple Node
Streaming with Express
Streaming with Hoffman

Closes #575

@smfoote
Copy link
Contributor

smfoote commented Mar 20, 2015

These examples are awesome! Nice work Seth. Sorry you missed your bus.

var dust = require('dustjs-linkedin');

var tmpl = dust.compile("Hello world! Using Dust version {version}!", "hello");
dust.loadSource(tmpl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have the example pre-compile the templates. not a fan of loadsource.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other examples do pre-compile, but this was intended to be the most simple example possible.

How would you want pre-compilation to work? I didn't want to make them run dustc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right. CJS loading would have been nice. There's compileFn and renderSource but both of those use loadSource underneath.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cjs is on my roadmap yeah.

On Mon, Mar 23, 2015, 7:03 AM Jimmy Chan notifications@github.com wrote:

In examples/basic-node/app.js
#577 (comment):

@@ -0,0 +1,12 @@
+var dust = require('dustjs-linkedin');
+
+var tmpl = dust.compile("Hello world! Using Dust version {version}!", "hello");
+dust.loadSource(tmpl);

you're right. CJS loading would have been nice. There's compileFn and
renderSource but both of those use loadSource underneath.


Reply to this email directly or view it on GitHub
https://github.com/linkedin/dustjs/pull/577/files#r26938213.

Simple browser
AMD in the browser
Super-simple Node
Streaming with Express
Streaming with Hoffman

[ci skip]
@jimmyhchan
Copy link
Contributor

looks good thanks 👍

prashn64 added a commit that referenced this pull request Mar 24, 2015
@prashn64 prashn64 merged commit c2360cb into linkedin:master Mar 24, 2015
@sethkinast sethkinast deleted the examples branch March 25, 2015 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add examples directory with some common Dust implementation examples
4 participants