linkedin / linkedin/dustjs

Create `dustr` tool to render templates on the command line

Open
#621 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
JavaScript
Stars
2.9k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

Replaces #354 since we removed the old `dustc` tool.

We will create a command-line tool that accepts a template and context, and renders the result to stdout or a file.

Use case: Generating static sites using Dust as a generator. Unit testing your app that uses Dust.

API examples:

```
$ dustr foo.dust --context=context.js
$ dustr tmpl/foo.dust --context=context.js --pwd=tmpl --output=site/foo.html
$ dustr tmpl/*.dust --output=site # split is automatic with dustr, creates site/foo.html, site/bar.html
$ dustr foo.dust --whitespace=true # no context required
```

`dustr` will implement an `onLoad` function to load and compile partials in the same way that `dustc` compiles them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the removed dustc tool and issue #354 to understand the existing compilation behavior, then trace how Dust templates and partials are currently loaded. Done means a dustr command accepts the described template, context, whitespace, working-directory, and output options, renders to stdout or files, expands globs, and loads partials through onLoad.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.