@jakubmazanec/template 1.0.0-a3e1bca → 1.0.0-next.493bd66
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 +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,8 +40,8 @@ variables:
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
The front matter is used for specifying template attributes that control how is the template
|
|
43
|
-
rendered.
|
|
44
|
-
rendered.
|
|
43
|
+
rendered. The default attributes can be written in EJS too and are rendered before the template
|
|
44
|
+
content is rendered.
|
|
45
45
|
|
|
46
46
|
It is expected that attribute `if` renders to a string that can be parsed as YAML value; if that
|
|
47
47
|
value is `false`, the rendering of the whole template is cancelled.
|
|
@@ -58,7 +58,7 @@ data during the template rendering:
|
|
|
58
58
|
|
|
59
59
|
```TypeScript
|
|
60
60
|
let template = await Template.read('template.ejs', {
|
|
61
|
-
dataSchema: z.object({value: z.number()}) // we have to specify the schema that
|
|
61
|
+
dataSchema: z.object({value: z.number()}) // we have to specify the schema that represents the template data type
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
console.log(await template.render({value: 1}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakubmazanec/template",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-next.493bd66",
|
|
4
4
|
"description": "TypeScript-first library for working with templates using EJS and Zod.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc --project tsconfig.typecheck.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jakubmazanec/error": "2.0.0-
|
|
29
|
+
"@jakubmazanec/error": "2.0.0-next.493bd66",
|
|
30
30
|
"ejs": "^3.1.9",
|
|
31
31
|
"fs-extra": "^11.1.1",
|
|
32
32
|
"gray-matter": "^4.0.3",
|