Save the app document to a local HTML file Args: blocks: The `Blocks` object or a list of Blocks path: File path to store the document open: Open in your browser after creating (default: False) name: Name of the document (optional: uses path if not provided)
(
blocks: BlocksT,
path: str,
open: bool = False,
name: str = "Report",
formatting: t.Optional[Formatting] = None,
)
| 75 | |
| 76 | |
| 77 | def save_report( |
| 78 | blocks: BlocksT, |
| 79 | path: str, |
| 80 | open: bool = False, |
| 81 | name: str = "Report", |
| 82 | formatting: t.Optional[Formatting] = None, |
| 83 | ) -> None: |
| 84 | """Save the app document to a local HTML file |
| 85 | |
| 86 | Args: |
| 87 | blocks: The `Blocks` object or a list of Blocks |
| 88 | path: File path to store the document |
| 89 | open: Open in your browser after creating (default: False) |
| 90 | name: Name of the document (optional: uses path if not provided) |
| 91 | formatting: Sets the basic app styling |
| 92 | """ |
| 93 | |
| 94 | s = ViewState(blocks=Blocks.wrap_blocks(blocks), file_entry_klass=B64FileEntry) |
| 95 | _: str = ( |
| 96 | Pipeline(s) |
| 97 | .pipe(PreProcessView(is_finalised=True)) |
| 98 | .pipe(ConvertXML()) |
| 99 | .pipe(ExportHTMLInlineAssets(path=path, open=open, name=name, formatting=formatting)) |
| 100 | .result |
| 101 | ) |
| 102 | |
| 103 | |
| 104 | def stringify_report( |
no test coverage detected