alanshaw / alanshaw/grunt-include-replace

Allow undeclared parameters to be defaulted

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
199
Forks
43
PR merge metrics
No merged PRs in 30d

Description

It would be really useful if you could set any null parameters to a default value. For instance:

snippet.html could contain:

``` html

@@one


@@two


```

And be included via:
`@@include("snippet.html", {"one":"text"})`

Currently, as nothing is passed in for `@@two` this will will display:

``` plain
text
@@two
```

It would be nice to be able to define a default value for parameters, so any missing parameters can be treated as a blank string by default (or have some default text entered) rather than showing the unused `@@` variable in the output.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.