Docstrings
Introduction
In this tutorial, you will learn how to use the Docstring widget in the Supervisely app. The Docstring widget allows you to display a given docstring as HTML-formatted content.
Read this tutorial in the developer portal.
Function signature
Docstring(
content="",
is_html=False,
widget_id=None,
)
Parameters
content
str
HTML content
is_html
bool
Determine if the given content has an HTML format
widget_id
str
ID of the widget
content
Determine input HTML content.
type: str
default value: ""

is_html
Determine if the given content has an HTML format.
type: bool
default value: False
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
set_content(content: str, is_html: bool)
Set Docstring content
get_content()
Return Docstring content
clear()
Clear Docstring content
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/misc/docstring/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare contents for Docstring widget
Docstring widgetYou can use 2 types of content:
raw docstring as a
strtype
html format string
Initialize Docstring widgets and set content types and values
Docstring widgets and set content types and valuesCreate app layout
Prepare a layout for the app using Card widget with the content parameter and place widget that we've just created in the Container widget.
Create app using layout
Create an app object with the layout parameter.
Last updated
Was this helpful?