@rse/nunjucks-cli 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -6
- package/nunjucks.1 +47 -0
- package/nunjucks.md +73 -0
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -4,8 +4,12 @@ nunjucks-cli
|
|
|
4
4
|
|
|
5
5
|
**Nunjucks Template Rendering Command-Line Interface**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
[](https://github.com/rse)
|
|
8
|
+
[](https://github.com/rse)
|
|
9
|
+
[](https://github.com/rse/nunjucks-cli)
|
|
10
|
+
<br/>
|
|
11
|
+
[](https://npmjs.com/@rse/nunjucks-cli)
|
|
12
|
+
[](https://npmjs.com/@rse/nunjucks-cli)
|
|
9
13
|
|
|
10
14
|
Abstract
|
|
11
15
|
--------
|
|
@@ -20,6 +24,8 @@ It optionally can load Nunjucks addons like the ones from the companion
|
|
|
20
24
|
Installation & Usage
|
|
21
25
|
--------------------
|
|
22
26
|
|
|
27
|
+
For the installation via Node Package Manager (NPM) use:
|
|
28
|
+
|
|
23
29
|
```sh
|
|
24
30
|
# plain functionality
|
|
25
31
|
$ npm install -g @rse/nunjucks-cli
|
|
@@ -30,7 +36,7 @@ $ npm install -g @rse/nunjucks-cli @rse/nunjucks-addons
|
|
|
30
36
|
$ nunjucks -e @rse/nunjucks-addons [...]
|
|
31
37
|
```
|
|
32
38
|
|
|
33
|
-
Alternatively, instead of globally installing it, you can also use it on-the-fly:
|
|
39
|
+
Alternatively, instead of globally installing it, you can also use it on-the-fly with NPM's npx(1) utility:
|
|
34
40
|
|
|
35
41
|
```sh
|
|
36
42
|
# plain functionality
|
|
@@ -41,12 +47,15 @@ $ npx --yes --package @rse/nunjucks-cli --package @rse/nunjucks-addons -- \
|
|
|
41
47
|
nunjucks -e @rse/nunjucks-addons [...]
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
Command-Line Interface (CLI)
|
|
51
|
+
----------------------------
|
|
52
|
+
|
|
53
|
+
Short excerpt of the CLI options and arguments from the companion [Unix manpage](nunjucks.md):
|
|
46
54
|
|
|
47
55
|
```
|
|
48
56
|
$ nunjucks
|
|
49
|
-
[-h|--help]
|
|
57
|
+
[-h|--help]
|
|
58
|
+
[-V|--version]
|
|
50
59
|
[-c|--config <config-file>]
|
|
51
60
|
[-C|--option <key>=<value>]
|
|
52
61
|
[-d|--defines <context-file>]
|
package/nunjucks.1
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.TH "NUNJUCKS" "1" "August 2023" "" ""
|
|
2
|
+
.SH "NAME"
|
|
3
|
+
\fBnunjucks\fR - Template Rendering Engine
|
|
4
|
+
.SH "SYNOPSIS"
|
|
5
|
+
.P
|
|
6
|
+
\fBnunjucks\fR \[lB]\fB-h\fR|\fB--help\fR\[rB] \[lB]\fB-V\fR|\fB--version\fR\[rB] \[lB]\fB-c\fR|\fB--config\fR \fIconfig-file\fR\[rB] \[lB]\fB-C\fR|\fB--option\fR \fIkey\fR=\fIvalue\fR\[rB] \[lB]\fB-d\fR|\fB--defines\fR \fIcontext-file\fR\[rB] \[lB]\fB-D\fR|\fB--define\fR \fIkey\fR=\fIvalue\fR\[rB] \[lB]\fB-e\fR|\fB--extension\fR \fImodule-name\fR\[rB] \[lB]\fB-o\fR|\fB--output\fR \fIoutput-file\fR|\fB-\fR\[rB] \[lB]\fIinput-file\fR|\fB-\fR\[rB]
|
|
7
|
+
.SH "DESCRIPTION"
|
|
8
|
+
.P
|
|
9
|
+
\fBnunjucks\fR(1) is a small command-line utility to render templates with the rich and powerful templating language \fBMozilla Nunjucks\fR \fI\(lahttps://mozilla.github.io/nunjucks/\(ra\fR. This allows you to define your configuration in a YAML file and then render an output file based on a template input file where your configuration can be expanded. It optionally can load Nunjucks addons like the ones from the companion \fBNunjucks Addons\fR \fI\(lahttps://github.com/rse/nunjucks-addons\(ra\fR package.
|
|
10
|
+
.SH "OPTIONS"
|
|
11
|
+
.P
|
|
12
|
+
The following top-level options and arguments exist:
|
|
13
|
+
.RS 0
|
|
14
|
+
.IP \(bu 4
|
|
15
|
+
\[lB]\fB-h\fR|\fB--help\fR\[rB] Show usage help.
|
|
16
|
+
.IP \(bu 4
|
|
17
|
+
\[lB]\fB-V\fR|\fB--version\fR\[rB] show program version information.
|
|
18
|
+
.IP \(bu 4
|
|
19
|
+
\[lB]\fB-c\fR|\fB--config\fR \fIconfig-file\fR\[rB] load Nunjucks configuration YAML file.
|
|
20
|
+
.IP \(bu 4
|
|
21
|
+
\[lB]\fB-C\fR|\fB--option\fR \fIkey\fR=\fIvalue\fR\[rB] set Nunjucks configuration option.
|
|
22
|
+
.IP \(bu 4
|
|
23
|
+
\[lB]\fB-d\fR|\fB--defines\fR \fIcontext-file\fR\[rB] load context definition YAML file.
|
|
24
|
+
.IP \(bu 4
|
|
25
|
+
\[lB]\fB-D\fR|\fB--define\fR \fIkey\fR=\fIvalue\fR\[rB] set context definition key/value.
|
|
26
|
+
.IP \(bu 4
|
|
27
|
+
\[lB]\fB-e\fR|\fB--extension\fR \fImodule-name\fR\[rB] load Nunjucks JavaScript extension module (installed via NPM).
|
|
28
|
+
.IP \(bu 4
|
|
29
|
+
\[lB]\fB-o\fR|\fB--output\fR \fIoutput-file\fR|\fB-\fR\[rB] save output file (or stdout).
|
|
30
|
+
.IP \(bu 4
|
|
31
|
+
\[lB]\fB<input-file>\fR|\fB-\fR\[rB] load input file (or stdin).
|
|
32
|
+
.RE 0
|
|
33
|
+
|
|
34
|
+
.SH "EXAMPLE"
|
|
35
|
+
.P
|
|
36
|
+
.RS 2
|
|
37
|
+
.nf
|
|
38
|
+
$ echo "Hello, {{who}}!" | nunjucks -D who=world -
|
|
39
|
+
Hello, world!
|
|
40
|
+
.fi
|
|
41
|
+
.RE
|
|
42
|
+
.SH "HISTORY"
|
|
43
|
+
.P
|
|
44
|
+
The \fBnunjucks\fR(1) utility was developed in August 2023 for being able to easily generate multiple configuration files for a complex \fIDocker-Compose\fR based setup.
|
|
45
|
+
.SH "AUTHOR"
|
|
46
|
+
.P
|
|
47
|
+
Dr. Ralf S. Engelschall \fI\(larse@engelschall.com\(ra\fR
|
package/nunjucks.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
# nunjucks(1) -- Template Rendering Engine
|
|
3
|
+
|
|
4
|
+
## SYNOPSIS
|
|
5
|
+
|
|
6
|
+
`nunjucks`
|
|
7
|
+
\[`-h`|`--help`\]
|
|
8
|
+
\[`-V`|`--version`\]
|
|
9
|
+
\[`-c`|`--config` *config-file*\]
|
|
10
|
+
\[`-C`|`--option` *key*=*value*\]
|
|
11
|
+
\[`-d`|`--defines` *context-file*\]
|
|
12
|
+
\[`-D`|`--define` *key*=*value*\]
|
|
13
|
+
\[`-e`|`--extension` *module-name*\]
|
|
14
|
+
\[`-o`|`--output` *output-file*|`-`\]
|
|
15
|
+
\[*input-file*|`-`\]
|
|
16
|
+
|
|
17
|
+
## DESCRIPTION
|
|
18
|
+
|
|
19
|
+
`nunjucks`(1) is a small command-line utility to render templates with the rich
|
|
20
|
+
and powerful templating language [Mozilla Nunjucks](https://mozilla.github.io/nunjucks/).
|
|
21
|
+
This allows you to define your configuration in a YAML file and then render
|
|
22
|
+
an output file based on a template input file where your configuration can be expanded.
|
|
23
|
+
It optionally can load Nunjucks addons like the ones from the companion
|
|
24
|
+
[Nunjucks Addons](https://github.com/rse/nunjucks-addons) package.
|
|
25
|
+
|
|
26
|
+
## OPTIONS
|
|
27
|
+
|
|
28
|
+
The following top-level options and arguments exist:
|
|
29
|
+
|
|
30
|
+
- \[`-h`|`--help`\]
|
|
31
|
+
Show usage help.
|
|
32
|
+
|
|
33
|
+
- \[`-V`|`--version`\]
|
|
34
|
+
show program version information.
|
|
35
|
+
|
|
36
|
+
- \[`-c`|`--config` *config-file*\]
|
|
37
|
+
load Nunjucks configuration YAML file.
|
|
38
|
+
|
|
39
|
+
- \[`-C`|`--option` *key*=*value*\]
|
|
40
|
+
set Nunjucks configuration option.
|
|
41
|
+
|
|
42
|
+
- \[`-d`|`--defines` *context-file*\]
|
|
43
|
+
load context definition YAML file.
|
|
44
|
+
|
|
45
|
+
- \[`-D`|`--define` *key*=*value*\]
|
|
46
|
+
set context definition key/value.
|
|
47
|
+
|
|
48
|
+
- \[`-e`|`--extension` *module-name*\]
|
|
49
|
+
load Nunjucks JavaScript extension module (installed via NPM).
|
|
50
|
+
|
|
51
|
+
- \[`-o`|`--output` *output-file*|`-`\]
|
|
52
|
+
save output file (or stdout).
|
|
53
|
+
|
|
54
|
+
- \[`<input-file>`|`-`\]
|
|
55
|
+
load input file (or stdin).
|
|
56
|
+
|
|
57
|
+
## EXAMPLE
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
$ echo "Hello, {{who}}!" | nunjucks -D who=world -
|
|
61
|
+
Hello, world!
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## HISTORY
|
|
65
|
+
|
|
66
|
+
The `nunjucks`(1) utility was developed in August 2023 for being
|
|
67
|
+
able to easily generate multiple configuration files for a complex
|
|
68
|
+
*Docker-Compose* based setup.
|
|
69
|
+
|
|
70
|
+
## AUTHOR
|
|
71
|
+
|
|
72
|
+
Dr. Ralf S. Engelschall <rse@engelschall.com>
|
|
73
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/nunjucks-cli",
|
|
3
3
|
"publishConfig": { "access": "public" },
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.3",
|
|
5
|
+
"stdver": "1.4.2.20230826-GA",
|
|
5
6
|
"description": "Nunjucks Template Rendering Command-Line Interface",
|
|
6
7
|
"author": {
|
|
7
8
|
"name": "Dr. Ralf S. Engelschall",
|
|
@@ -10,11 +11,11 @@
|
|
|
10
11
|
},
|
|
11
12
|
"license": "MIT",
|
|
12
13
|
"repository": {
|
|
13
|
-
"type":
|
|
14
|
-
"url":
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git://github.com/rse/nunjucks-cli.git"
|
|
15
16
|
},
|
|
16
17
|
"bugs": {
|
|
17
|
-
"url":
|
|
18
|
+
"url": "http://github.com/rse/nunjucks-cli/issues"
|
|
18
19
|
},
|
|
19
20
|
"bin": {
|
|
20
21
|
"nunjucks": "nunjucks.js"
|
|
@@ -26,15 +27,19 @@
|
|
|
26
27
|
"js-yaml": "4.1.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"eslint": "8.
|
|
30
|
+
"eslint": "8.48.0",
|
|
30
31
|
"eslint-config-standard": "17.1.0",
|
|
31
32
|
"eslint-plugin-promise": "6.1.1",
|
|
32
33
|
"eslint-plugin-import": "2.28.1",
|
|
33
|
-
"eslint-plugin-node": "11.1.0"
|
|
34
|
+
"eslint-plugin-node": "11.1.0",
|
|
35
|
+
"remark-cli": "11.0.0",
|
|
36
|
+
"remark": "14.0.3",
|
|
37
|
+
"remark-man": "8.0.1"
|
|
34
38
|
},
|
|
35
39
|
"upd": [ "!chalk" ],
|
|
36
40
|
"scripts": {
|
|
37
41
|
"lint": "eslint --config eslint.yaml nunjucks.js",
|
|
42
|
+
"man": "remark --quiet --use remark-man --output nunjucks.1 nunjucks.md",
|
|
38
43
|
"test": "echo 'Hello, {{who}}!' | node nunjucks.js -D who=world -"
|
|
39
44
|
}
|
|
40
45
|
}
|