-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from syumai/release-0.10.3
Release 0.10.3
- Loading branch information
Showing
9 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
Copyright 2018-present [syumai](https://github.com/syumai/) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
|
||
[![Build Status](https://github.com/syumai/dejs/workflows/test/badge.svg?branch=master)](https://github.com/syumai/dejs/actions) | ||
|
||
- [ejs](https://ejs.co) template engine for [deno](https://github.com/denoland/deno). | ||
- [ejs](https://ejs.co) template engine for | ||
[deno](https://github.com/denoland/deno). | ||
|
||
## Features | ||
|
||
|
@@ -21,18 +22,18 @@ | |
## Usage | ||
|
||
```ts | ||
import * as dejs from "https://deno.land/x/[email protected].2/mod.ts"; | ||
import * as dejs from "https://deno.land/x/[email protected].3/mod.ts"; | ||
``` | ||
|
||
- **`renderFile`**`(filePath: string, params: Params): Promise<Deno.Reader>` | ||
- **`renderFile`** `(filePath: string, params: Params): Promise<Deno.Reader>` | ||
- renders from file, outputs Deno.Reader | ||
- **`render`**`(body: string, params: Params): Promise<Deno.Reader>` | ||
- **`render`** `(body: string, params: Params): Promise<Deno.Reader>` | ||
- renders from string, outputs Deno.Reader | ||
- **`renderFileToString`**`(filePath: string, params: Params): Promise<string>` | ||
- **`renderFileToString`** `(filePath: string, params: Params): Promise<string>` | ||
- renders from file, outputs string | ||
- **`renderToString`**`(body: string, params: Params): Promise<string>` | ||
- **`renderToString`** `(body: string, params: Params): Promise<string>` | ||
- renders from string, outputs string | ||
- **`compile`**`(reader: Reader): Promise<Template>` | ||
- **`compile`** `(reader: Reader): Promise<Template>` | ||
- only compiles ejs and returns `Template(params: Params): string` | ||
- use this to cache compiled result of ejs | ||
|
||
|
@@ -56,7 +57,7 @@ import { renderFile } from "https://deno.land/x/dejs/mod.ts"; | |
|
||
(async () => { | ||
const output = await renderFile(`${cwd()}/template.ejs`, { | ||
name: "world" | ||
name: "world", | ||
}); | ||
await copy(output, stdout); | ||
})(); | ||
|
@@ -87,7 +88,7 @@ const template = `<body> | |
|
||
(async () => { | ||
const output = await render(template, { | ||
name: "world" | ||
name: "world", | ||
}); | ||
await copy(output, stdout); | ||
})(); | ||
|
@@ -96,7 +97,8 @@ const template = `<body> | |
### Include partial ejs template | ||
|
||
- To include template from other file, use `include` function in ejs. | ||
- `include` resolves views from relative path from **executed ts / js file**. (not from ejs template file). | ||
- `include` resolves views from relative path from **executed ts / js file**. | ||
(not from ejs template file). | ||
- This behavior may change in the future. | ||
|
||
#### Usage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "dejs", | ||
"description": "ejs template engine for deno.", | ||
"homepage": "https://github.com/syumai/dejs", | ||
"files": [ | ||
"name": "dejs", | ||
"description": "ejs template engine for deno.", | ||
"homepage": "https://github.com/syumai/dejs", | ||
"files": [ | ||
"./**/*.ts", | ||
"README.md" | ||
], | ||
"entry": "./mod.ts" | ||
], | ||
"entry": "./mod.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "https://deno.land/std@0.113.0/io/buffer.ts"; | ||
export * from "https://deno.land/std@0.137.0/io/buffer.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "https://deno.land/std@0.113.0/io/bufio.ts"; | ||
export * from "https://deno.land/std@0.137.0/io/bufio.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "https://deno.land/std@0.113.0/io/util.ts"; | ||
export * from "https://deno.land/std@0.137.0/io/util.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "https://deno.land/std@0.113.0/testing/asserts.ts"; | ||
export * from "https://deno.land/std@0.137.0/testing/asserts.ts"; |