Options
All
  • Public
  • Public/Protected
  • All
Menu

Built-in Nunjucks filters.

Hierarchy

  • NunjucksBuiltInFilters

Index

Constructors

constructor

Methods

Static await

  • await(func: Function, callback: Function): Promise<void>
  • Awaits an async function. Usage: {{asyncFunction()|await}}

    Parameters

    • func: Function

      The async function to await.

    • callback: Function

      The callback invoked by async Nunjucks filters.

    Returns Promise<void>

Static formatBytes

  • formatBytes(value: number): string
  • Formats bytes in a human-readable way.

    Parameters

    • value: number

      Number in bytes.

    Returns string

    Bytes formatted in a human-readable way.

Static markdown

  • markdown(value: string): string
  • Converts Markdown to HTML.

    Parameters

    • value: string

      Markdown to convert.

    Returns string

    Markdown converted to HTML.

Static relative

  • relative(value: string | Document): string
  • Returns a URL relative to the current document.

    Parameters

    • value: string | Document

      Destination URL.

    Returns string

    The URL relative to the current document.

Static t

  • Returns a translation in the current document's locale, for a string.

    Parameters

    Returns any

    The translation of value.

Generated using TypeDoc