Skip to content

Open toggle buttons when printing #14

Closed

Description

@DavidPowell

When printing pages containing this toggle button (e.g. printing a page created with Jupyter-book using the download PDF button), any toggled contents remain hidden, unless manually toggled

For my use case it would make sense to show all content when printing, I would expect this would be the case for most other users.

Activity

  1. choldgraf commented on Jul 22, 2020

    @choldgraf
    Member

    I think that makes sense - the thing to do would be to add a print rule here: https://github.com/executablebooks/sphinx-togglebutton/blob/master/sphinx_togglebutton/_static/togglebutton.css_t

    and forcibly display the toggled content. I guess the other thing we could do is add some JS to remove the "toggle" class when "print" is clicked, but that feels a bit hackier

  2. DavidPowell commented on Nov 17, 2020

    @DavidPowell
    Author

    Thanks for hints, and sorry for very much delayed response.

    As far as I can see, what is required is to just turn off all CSS when print media is used. This is exactly what I have done in this commit: DavidPowell@e2d84f6.

    I have limited knowledge of CSS, so I don't know if there are any unintended side-effects. If it's okay, I'll submit a PR.

  3. JoachimWackerow commented on Mar 31, 2021

    @JoachimWackerow

    From another perspective, it might make sense to print what you see. The user hits the toggle buttons which should be shown for the print.

    Currently a print shows lots of white space if a toggle for a table is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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