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

show() method with "auto" does not produce anything in IPython console #80

Open
machow opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@machow
Copy link
Collaborator

machow commented Jan 3, 2024

When run in jupyterlab, the TagList.show() method produces html output. However, when run from an ipython console session (e.g. when running ipython from your terminal), nothing happens.

It seems like the culprit is this line, which does not distinguish between the console and notebook/lab:

            ipy = (  # pyright: ignore[reportUnknownVariableType]
                IPython.get_ipython()  # pyright: ignore[reportUnknownMemberType]
            )
            renderer = "ipython" if ipy else "browser"

In plotly, it appears they detect the console by running this code:

ipython.get_ipython().__class__.__name__ == "TerminalInteractiveShell"

It seems like the code above would allow auto htmltools to set renderer to "browser" when in an ipython session.

Related to posit-dev/great-tables#100

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

1 participant