Skip to content

Commit

Permalink
update url
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingZhang committed Jul 12, 2020
1 parent b6b2897 commit c4af8e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Template engine for Deno

### render
```ts
import Template from "https://deno.land/x/template@0.1.0/mod.ts";
import Template from "https://deno.land/x/template@v0.1.0/mod.ts";
const tpl = new Template();
const str = tpl.render("abc{{name}}{{name2}}def\n{{fn}}s{{p.arr}}ww", {
name: "def",
Expand All @@ -22,7 +22,7 @@ assert(
### compile
Reuse compiled function
```ts
import Template from "https://deno.land/x/template@0.1.0/mod.ts";
import Template from "https://deno.land/x/template@v0.1.0/mod.ts";
const tpl = new Template();
const compiled = tpl.compile("abc{{name}}");
const str1 = tpl.renderCompiled(compiled, { name: "def" });
Expand All @@ -33,7 +33,7 @@ assert(str2 === "abcxyz");

### not escape
```ts
import Template from "https://deno.land/x/template@0.1.0/mod.ts";
import Template from "https://deno.land/x/template@v0.1.0/mod.ts";
const tpl = new Template({
isEscape: false,
});
Expand All @@ -55,7 +55,7 @@ assertEquals(tpl.renderCompiled(compiled, data), result);

### open and close
```ts
import Template from "https://deno.land/x/template@0.1.0/mod.ts";
import Template from "https://deno.land/x/template@v0.1.0/mod.ts";
const tpl = new Template({
open: "<%",
close: "%>",
Expand All @@ -73,7 +73,7 @@ assertEquals(str, "abcdef");
### renderFile
Compiled functions are cached
```ts
import Template from "https://deno.land/x/template@0.1.0/mod.ts";
import Template from "https://deno.land/x/template@v0.1.0/mod.ts";
const tpl = new Template();
const data = { name: "def" };
const result = tpl.renderFile("./index.html", data);
Expand Down

0 comments on commit c4af8e8

Please sign in to comment.