MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / put_tabs

Function put_tabs

pywebio/output.py:1213–1244  ·  view source on GitHub ↗

Output tabs. :param list tabs: Tab list, each item is a dict: ``{"title": "Title", "content": ...}`` . The ``content`` can be a string, the ``put_xxx()`` calls , or a list of them. :param int scope, position: Those arguments have the same meaning as for `put_text()` .. exportabl

(tabs: List[Dict[str, Any]], scope: str = None, position: int = OutputPosition.BOTTOM)

Source from the content-addressed store, hash-verified

1211
1212@safely_destruct_output_when_exp('tabs')
1213def put_tabs(tabs: List[Dict[str, Any]], scope: str = None, position: int = OutputPosition.BOTTOM) -> Output:
1214 """Output tabs.
1215
1216 :param list tabs: Tab list, each item is a dict: ``{"title": "Title", "content": ...}`` .
1217 The ``content`` can be a string, the ``put_xxx()`` calls , or a list of them.
1218 :param int scope, position: Those arguments have the same meaning as for `put_text()`
1219
1220 .. exportable-codeblock::
1221 :name: put_tabs
1222 :summary: `put_tabs()` usage
1223
1224 put_tabs([
1225 {'title': 'Text', 'content': 'Hello world'},
1226 {'title': 'Markdown', 'content': put_markdown('~~Strikethrough~~')},
1227 {'title': 'More content', 'content': [
1228 put_table([
1229 ['Commodity', 'Price'],
1230 ['Apple', '5.5'],
1231 ['Banana', '7'],
1232 ]),
1233 put_link('pywebio', 'https://github.com/wang0618/PyWebIO')
1234 ]},
1235 ])
1236
1237 .. versionadded:: 1.3
1238 """
1239
1240 for tab in tabs:
1241 assert 'title' in tab and 'content' in tab
1242
1243 spec = _get_output_spec('tabs', tabs=tabs, scope=scope, position=position)
1244 return Output(spec)
1245
1246
1247@safely_destruct_output_when_exp('data')

Callers 2

targetFunction · 0.85
output_widgetsFunction · 0.85

Calls 2

_get_output_specFunction · 0.85
OutputClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…