#!/usr/bin/env python3 from nicegui import ui, wp from contextlib import contextmanager from icecream import ic import inspect from executing import Source from nicegui.elements.element import Element import sys import docutils.core # add docutils css to webpage wp.head_html += docutils.core.publish_parts('', writer_name='html')['stylesheet'] @contextmanager def example(element: Element): callFrame = inspect.currentframe().f_back.f_back begin = callFrame.f_lineno with ui.row(): doc = element.__init__.__doc__ html = docutils.core.publish_parts(doc, writer_name='html')['html_body'] html = html.replace('
', '