Toloka documentation

Assets

toloka.client.project.view_spec.ClassicViewSpec.Assets | Source code

Assets(
    self,
    *,
    style_urls: Optional[List[str]] = None,
    script_urls: Optional[List[str]] = None
)

Linked files with assets.

Parameters Description

Parameters Type Description
style_urls Optional[List[str]]

Links to CSS libraries.

script_urls Optional[List[str]]

Links to JavaScript libraries and Toloka assets. Toloka assets:

  • "TOLOKA_ASSETS/js/toloka-handlebars-templates.js" — [Handlebars template engine](http://handlebarsjs.com/).
  • "TOLOKA_ASSETS/js/image-annotation.js" — Image labeling interface. For more information, see Image with area selection. Note that the image labeling interface should only be connected together with the Handlebars helpers. The order of connection matters.

Examples:

from toloka.client.project.view_spec import ClassicViewSpec
view_spec = ClassicViewSpec(
    ...,
    assets = ClassicViewSpec.Assets(
        script_utls = [
            "$TOLOKA_ASSETS/js/toloka-handlebars-templates.js",
            "$TOLOKA_ASSETS/js/image-annotation.js",
        ]
    )
)