141 def create(self):
142 """
143 Show the widget.
144 """
145 import ipywidgets as widgets
146
147 html = widgets.HTML()
148 html.value = self.table_beginning_html
149
150 if self.standalone:
151 if isinstance(self.module.name, str):
152 module_name = self.module.name
153 else:
154 module_name = self.module.name()
155
156 html.value += self.table_title_html.format(module_name=module_name, package=self.module.package(),
157 td_style=self.td_html)
158
159 html.value += self.table_row_html_single.format(text=self.module.description(), td_style=self.td_html)
160
161 if len(self.module.available_params()) == 0:
162 html.value += self.table_row_html_single.format(text="No parameters available.", td_style=self.td_html)
163 else:
164 for param in self.module.available_params():
165 color_text = self.get_color_code(param)
166
167 if self.standalone:
168 table_row_html = self.table_row_help
169 else:
170 table_row_html = self.table_row_parameters
171
172 html.value += table_row_html.format(param=param, color_text=color_text, td_style=self.td_html)
173 html.value += "</table>"
174
175 return html
176
177