feat: move filters/tags to instances, fixes #188

This commit is contained in:
harttle
2020-03-03 00:02:29 +08:00
parent f6762078e0
commit df8a919f71
47 changed files with 240 additions and 221 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
import { RenderError } from '../util/error'
import { Context } from '../context/context'
import { ITemplate } from '../template/itemplate'
import { Template } from '../template/template'
import { Emitter } from './emitter'
export class Render {
public * renderTemplates (templates: ITemplate[], ctx: Context, emitter = new Emitter()): IterableIterator<string> {
public * renderTemplates (templates: Template[], ctx: Context, emitter = new Emitter()): IterableIterator<string> {
for (const tpl of templates) {
try {
const html = yield tpl.render(ctx, emitter)