alanshaw / alanshaw/grunt-include-replace

Allow undeclared parameters to be defaulted

Offen
#66 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
199
Forks
43
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.