Class: Liquid

Hierarchy

  • Liquid

Constructors

constructor

+ new Liquid(opts: LiquidOptions): Liquid

Defined in liquid.ts:27

Parameters:

Name Type Default
opts LiquidOptions {}

Returns: Liquid

Properties

filters

filters: FilterMap

Defined in liquid.ts:25


Private fs

fs: FS

Defined in liquid.ts:27


options

options: NormalizedFullOptions

Defined in liquid.ts:22


parser

parser: Parser

Defined in liquid.ts:24


renderer

renderer: Render

Defined in liquid.ts:23


tags

tags: TagMap

Defined in liquid.ts:26

Methods

_evalValue

_evalValue(str: string, ctx: Context): IterableIterator‹any›

Defined in liquid.ts:106

Parameters:

Name Type
str string
ctx Context

Returns: IterableIterator‹any›


_parseAndRender

_parseAndRender(html: string, scope?: undefined | object, opts?: LiquidOptions, sync?: undefined | false | true): IterableIterator‹string›

Defined in liquid.ts:58

Parameters:

Name Type
html string
scope? undefined | object
opts? LiquidOptions
sync? undefined | false | true

Returns: IterableIterator‹string›


_parseFile

_parseFile(file: string, opts?: LiquidOptions, sync?: undefined | false | true): IterableIterator‹any›

Defined in liquid.ts:69

Parameters:

Name Type
file string
opts? LiquidOptions
sync? undefined | false | true

Returns: IterableIterator‹any›


_render

_render(tpl: Template[], scope?: undefined | object, opts?: LiquidOptions, sync?: undefined | false | true): IterableIterator‹string›

Defined in liquid.ts:46

Parameters:

Name Type
tpl Template[]
scope? undefined | object
opts? LiquidOptions
sync? undefined | false | true

Returns: IterableIterator‹string›


evalValue

evalValue(str: string, ctx: Context): Promise‹any›

Defined in liquid.ts:110

Parameters:

Name Type
str string
ctx Context

Returns: Promise‹any›


evalValueSync

evalValueSync(str: string, ctx: Context): any

Defined in liquid.ts:113

Parameters:

Name Type
str string
ctx Context

Returns: any


express

express(): (Anonymous function)

Defined in liquid.ts:126

Returns: (Anonymous function)


getTemplate

getTemplate(file: string, opts?: LiquidOptions): Promise‹Template[]›

Defined in liquid.ts:144

deprecated use parseFile instead

Parameters:

Name Type
file string
opts? LiquidOptions

Returns: Promise‹Template[]›


getTemplateSync

getTemplateSync(file: string, opts?: LiquidOptions): Template[]

Defined in liquid.ts:150

deprecated use parseFileSync instead

Parameters:

Name Type
file string
opts? LiquidOptions

Returns: Template[]


Private lookupError

lookupError(file: string, roots: string[]): any

Defined in liquid.ts:134

Parameters:

Name Type
file string
roots string[]

Returns: any


parse

parse(html: string, filepath?: undefined | string): Template[]

Defined in liquid.ts:40

Parameters:

Name Type
html string
filepath? undefined | string

Returns: Template[]


parseAndRender

parseAndRender(html: string, scope?: undefined | object, opts?: LiquidOptions): Promise‹string›

Defined in liquid.ts:62

Parameters:

Name Type
html string
scope? undefined | object
opts? LiquidOptions

Returns: Promise‹string›


parseAndRenderSync

parseAndRenderSync(html: string, scope?: undefined | object, opts?: LiquidOptions): string

Defined in liquid.ts:65

Parameters:

Name Type
html string
scope? undefined | object
opts? LiquidOptions

Returns: string


parseFile

parseFile(file: string, opts?: LiquidOptions): Promise‹Template[]›

Defined in liquid.ts:90

Parameters:

Name Type
file string
opts? LiquidOptions

Returns: Promise‹Template[]›


parseFileSync

parseFileSync(file: string, opts?: LiquidOptions): Template[]

Defined in liquid.ts:93

Parameters:

Name Type
file string
opts? LiquidOptions

Returns: Template[]


plugin

plugin(plugin: function): void

Defined in liquid.ts:123

Parameters:

plugin: function

▸ (this: Liquid, L: Liquid): void

Parameters:

Name Type
this Liquid
L Liquid

Returns: void


registerFilter

registerFilter(name: string, filter: FilterImplOptions): void

Defined in liquid.ts:117

Parameters:

Name Type
name string
filter FilterImplOptions

Returns: void


registerTag

registerTag(name: string, tag: TagImplOptions): void

Defined in liquid.ts:120

Parameters:

Name Type
name string
tag TagImplOptions

Returns: void


render

render(tpl: Template[], scope?: undefined | object, opts?: LiquidOptions): Promise‹string›

Defined in liquid.ts:51

Parameters:

Name Type
tpl Template[]
scope? undefined | object
opts? LiquidOptions

Returns: Promise‹string›


renderFile

renderFile(file: string, ctx?: undefined | object, opts?: LiquidOptions): Promise‹string›

Defined in liquid.ts:96

Parameters:

Name Type
file string
ctx? undefined | object
opts? LiquidOptions

Returns: Promise‹string›


renderFileSync

renderFileSync(file: string, ctx?: undefined | object, opts?: LiquidOptions): string

Defined in liquid.ts:100

Parameters:

Name Type
file string
ctx? undefined | object
opts? LiquidOptions

Returns: string


renderSync

renderSync(tpl: Template[], scope?: undefined | object, opts?: LiquidOptions): string

Defined in liquid.ts:54

Parameters:

Name Type
tpl Template[]
scope? undefined | object
opts? LiquidOptions

Returns: string