From 6cc7c05f4f734a7bb52b08ea050db25626d727ba Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 23 Jan 2024 13:32:14 -0500 Subject: [PATCH] update syntax for latest version of shinylive in PR --- shiny/_docstring.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shiny/_docstring.py b/shiny/_docstring.py index da6f6ee89..8d5d02ba2 100644 --- a/shiny/_docstring.py +++ b/shiny/_docstring.py @@ -177,15 +177,19 @@ def _(func: F) -> F: # This part is hidden from the typechecker because shinylive is not a direct # dependency of shiny and we only need this section when building the docs. try: - import shinylive + from shinylive import ShinyliveApp + except ImportError: + raise RuntimeError( + "Please install the latest version of shinylive to build the docs." + ) except ModuleNotFoundError: raise RuntimeError("Please install shinylive to build the docs.") class ShinyliveExampleWriter(ExampleWriter): def write_example(self, app_files: list[str]) -> str: app_file = app_files.pop(0) - app = shinylive.url_encode(app_file, app_files, language="py") + app = ShinyliveApp.from_local(app_file, app_files, language="py") - return app.chunk(layout="vertical", viewerHeight=400) + return app.chunk(layout="vertical", viewer_height=400) example_writer = ShinyliveExampleWriter()