Skip to content

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

@machow

Description

@machow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions