diff --git a/argilla/docs/how_to_guides/custom_fields.md b/argilla/docs/how_to_guides/custom_fields.md index cb37197007..7ea93046f3 100644 --- a/argilla/docs/how_to_guides/custom_fields.md +++ b/argilla/docs/how_to_guides/custom_fields.md @@ -178,8 +178,18 @@ When `advanced_mode=True`, you can use the `template` argument to pass a full HT Let's reproduce example from the [Without advanced mode](#without-advanced-mode) section but this time we will insert the [handlebars syntax engine](https://handlebarsjs.com/) into the template ourselves. ```python -render_template = """ +template = """ +
""" # (2) ``` -1. This is a JavaScript template script. We set `id` to `template` to use it later in our JavaScript code and `type` to `text/x-handlebars-template` to indicate that this is a Handlebars template. -2. This is a JavaScript template script. We load the Handlebars library and then use it to compile the template and render the record. +1. This is a JavaScript template script. We set `id` to `template` to use it later in our JavaScript code and `type` to `text/x-handlebars-template` to indicate that this is a Handlebars template. Note that we also added a `div` with `id` to `content` to render the template into. +2. This is a JavaScript template script. We load the Handlebars library and then use it to compile the template and render the record. Eventually, we render the result into the `div` with `id` to `content`. We can now pass these templates to the `CustomField` class, ensuring that the `advanced_mode` is set to `True`. @@ -214,7 +224,7 @@ import argilla as rg custom_field = rg.CustomField( name="image", - template=render_template + script, + template=template + script, advanced_mode=True ) ```