linkedin/dustjs — pull request #354 by dceb (2013-10-22 20:28:26+00:00)
Title: Add multitemplate and render support to dustc.

Being able to pre-compile dust is great when it needs to be rendered by the browser, but we're also using dust as a templating language for static HTML pages (such as "about us", etc) which we compile in advance. This patch adds rendering support (`-r`, with optional context `-c=`) to the dustc command, to make it easier to generate such pages.

In order to support rendering with partials, this patch also adds multiple-source file support and automatic searching for dependencies in the process's working directory (`-f` option).

The context for rendering, specified by `-c=`, can either be inline json embedded in the command line or the path to a javascript source file. In the latter case, the source file is treated like a node module, and its `module.exports` is used as the render context.

I've also added a `-v` verbose option, as a way to see which files are parsed while dustc is running.