Skip to content

DOC: Add sphinx-togglepromt for python code block examples #47785

Closed
@Transurgeon

Description

@Transurgeon

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

Example 1:
https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.groupby.html

Example 2:
https://pandas.pydata.org/docs/dev/reference/api/pandas.crosstab.html#pandas.crosstab

Documentation problem

In the code blocks for the API examples, sometimes there are multiple outputs. This makes it cumbersome to copy the code for rapid conversion to local development.

I was thinking it would be convenient if there was a way to hide the outputs of the code blocks.

Suggested fix for documentation

I did some searching online and found an existing package that does the job.

Repo of toggleprompt

Additionally, we could add a similar javascript file under doc/source/_static that could take care of this issue, instead of downloading an additional package.

Link to implementation of this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions