Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A terminal component blocks the execution of all subsequent viewers #28

Open
perellonieto opened this issue Oct 12, 2023 · 2 comments
Open

Comments

@perellonieto
Copy link

perellonieto commented Oct 12, 2023

If a code block includes the component terminal all the subsequent code blocks that have a viewer are not rendered (with quarto version 1.3.450).

The following is a code example that does not allow the 2 last code blocks to render.

```{shinylive-python}
#| components: [editor, terminal]

print('First code will prevent the rest of the code blocks from showing their rendered output')
```

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer]
from shiny import App, ui

app_ui = ui.page_fluid("The text in the second code block is not shown.")

app = App(app_ui, None)
```

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer]
from shiny import App, ui

app_ui = ui.page_fluid("The text in the third code block is not shown.")

app = App(app_ui, None)
```

A live example can be seen at https://tailor-uob.github.io/mooc_trustworthy_ai/cha_sl/shinylive-not-working.html
and the source code of the example at https://github.com/TAILOR-UoB/mooc_trustworthy_ai/blob/main/cha_sl/shinylive-not-working.qmd

@wch
Copy link
Collaborator

wch commented Oct 16, 2023

Thanks for providing the very clear example. If there is a viewer block before the terminal, does it run?

@perellonieto perellonieto changed the title An editor component blocks the execution of all subsequent viewers A terminal component blocks the execution of all subsequent viewers Oct 19, 2023
@perellonieto
Copy link
Author

I changed the title as I meant a terminal blocks the subsequent viewers.

If I only add a viewer to the previous code

```{shinylive-python}
#| components: [editor, viewer, terminal]

print('First code will prevent the rest of the code blocks from showing their rendered output')
```

it raises an error about the argument #| standalone: true being necessary.

If I add the #| standalone: true option

```{shinylive-python}
#| standalone: true
#| components: [editor, terminal]

print('First code will prevent the rest of the code blocks from showing their rendered output')
```

I raises the error '#| standalone: true' is not valid for editor-terminal and editor-cell code blocks. which may be related to this issue.

And if I add both the #| standalone: true option and the viewer

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer, terminal]

print('First code will prevent the rest of the code blocks from showing their rendered output')
```

the page is rendered as expected. Then as indicated above the original problem is that the current implementation of the shinylive extension does not support a standalone terminal.

If this is correct, are there any plans to work on the standalone argument?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants