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

[Feature request] Hide and Unhide PowerPoint Slides #622

Open
laresbernardo opened this issue Oct 9, 2024 · 6 comments
Open

[Feature request] Hide and Unhide PowerPoint Slides #622

laresbernardo opened this issue Oct 9, 2024 · 6 comments
Assignees

Comments

@laresbernardo
Copy link

I've reviewed all the available documentation and haven't seen an option to hide or unhide a slide. This is a valuable functionality and I wouldn't expect it to be too complex to include in the package.

Use Case: I've included an appendix slide that contains the code to replicate the deck. There's no need to include this slide in a presentation but it's super useful to have in the deck.

Thanks for this amazing package!

@laresbernardo laresbernardo changed the title Feat request: Hide or Unhide Slides [Feature request] Hide and Unhide PowerPoint Slides Oct 9, 2024
@davidgohel
Copy link
Owner

davidgohel commented Oct 9, 2024

I wouldn't expect it to be too complex

How do you estimate that ? Do you have pointers that show how to implement it ?

@laresbernardo
Copy link
Author

You are right, I don't. Sorry if that sounded rude. I extrapolated from the advanced functionalities I've seen already implemented in officer and thought it was a matter of finding the right "command" to hide and unhide slides. No foundations to back the comment. Hope it's not complicated though!

@markheckmann
Copy link
Contributor

markheckmann commented Oct 14, 2024

Technical

On a technical level, it appears that a slide is hidden (shown) by setting the show attribute in the p:sld node to 0 (1) (in the slide xml file).

<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" 
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" show="0">
...
</p:sld>

API

Does someone have a suggestion for the API? Some options could be:

  • a visible arg in add_slide() which defaults to TRUE
  • a new function slide_visible() to get and set a slide's visibility (e.g. hide and show arg taking slide indexes)

Examples:

add_slide(x, "Title Slide", visible = FALSE)

slide_visible(x)
[1] TRUE TRUE TRUE TRUE

slide_visible(x, hide = 2:3)
slide_visible(x, show = c(1,4))

slide_visible(x)[2:3] <- FALSE

@davidgohel Please feel free to assign this issue to me, if you find it is a suitable feature

@markheckmann
Copy link
Contributor

@laresbernardo Out of curiuosity: Would you mind telling a bit more about your use case? I was never in a situation where I needed to generate hidden slides, when creating them programatically...

@laresbernardo
Copy link
Author

@markheckmann of course, as I shared in my first comment, I'm generating a slide at the end of the deck that contains the code to replicate the deck. It also contains a full JSON formatted string with all the results (not shown in the nice slides but that may be useful). Given these decks I'm working on are ready to be pitched/shared, I wouldn't want them to be shown while presenting.

@davidgohel
Copy link
Owner

@laresbernardo in this use case, using comments/notes instead of hidden slide seems more relevant to me but it's only a point of view.

You can have a look at set_notes()

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

3 participants