Assets

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

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

Links to external files.

You can link:

  • CSS libraries

  • JavaScript libraries

  • Toloka assets — libraries that can be linked using the $TOLOKA_ASSETS path:

    • $TOLOKA_ASSETS/js/toloka-handlebars-templates.jsHandlebars template engine.

    • $TOLOKA_ASSETS/js/image-annotation.js — Image labeling interface. Note, that this library requires Handlebars and must be linked after it.

      For more information, see Image with area selection.

    Add items in the order they should be linked.

Parameters description

ParametersTypeDescription
style_urlsOptional[List[str]]

Links to CSS libraries.

script_urlsOptional[List[str]]

Links to JavaScript libraries and Toloka assets.

Examples:

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

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming