Skip to content

Commit dd615e5

Browse files
committed
update syntax for latest version of shinylive in PR
1 parent 533562c commit dd615e5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

shiny/_docstring.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,19 @@ def _(func: F) -> F:
177177
# This part is hidden from the typechecker because shinylive is not a direct
178178
# dependency of shiny and we only need this section when building the docs.
179179
try:
180-
import shinylive
180+
from shinylive import ShinyliveApp
181+
except ImportError:
182+
raise RuntimeError(
183+
"Please install the latest version of shinylive to build the docs."
184+
)
181185
except ModuleNotFoundError:
182186
raise RuntimeError("Please install shinylive to build the docs.")
183187

184188
class ShinyliveExampleWriter(ExampleWriter):
185189
def write_example(self, app_files: list[str]) -> str:
186190
app_file = app_files.pop(0)
187-
app = shinylive.url_encode(app_file, app_files, language="py")
191+
app = ShinyliveApp.from_local(app_file, app_files, language="py")
188192

189-
return app.chunk(layout="vertical", viewerHeight=400)
193+
return app.chunk(layout="vertical", viewer_height=400)
190194

191195
example_writer = ShinyliveExampleWriter()

0 commit comments

Comments
 (0)