(
cls, opt_out: bool = True, show_code: bool = False, show_markdown: bool = True, template: str = "auto"
)
| 41 | |
| 42 | @classmethod |
| 43 | def from_notebook( |
| 44 | cls, opt_out: bool = True, show_code: bool = False, show_markdown: bool = True, template: str = "auto" |
| 45 | ) -> Self: |
| 46 | from datapane.ipython import templates as ip_t |
| 47 | from datapane.ipython.utils import cells_to_blocks |
| 48 | |
| 49 | blocks = cells_to_blocks(opt_out=opt_out, show_code=show_code, show_markdown=show_markdown) |
| 50 | app_template_cls = ip_t._registry.get(template) or ip_t.guess_template(blocks) |
| 51 | app_template = app_template_cls(blocks) |
| 52 | app_template.transform() |
| 53 | app_template.validate() |
| 54 | return cls(blocks=app_template.blocks) |
| 55 | |
| 56 | def get_dom(self) -> ElementT: |
| 57 | """Return the Document structure for the View""" |
nothing calls this directly
no test coverage detected