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

622 hide slides (#622) #631

Merged
merged 13 commits into from
Jan 2, 2025
Merged

Conversation

markheckmann
Copy link
Contributor

Happy New Year, @davidgohel !

As requested in #622 by @laresbernardo, this PR adds the function slide_visible() (see examples below).

NB: Adding a visible arg to add_slide() will be part of another PR.

library(officer)

path <- system.file("doc_examples/example.pptx", package = "officer")
x <- read_pptx(path)

slide_visible(x) # get slide visibility
#> [1] TRUE TRUE TRUE

slide_visible(x, hide = 1:2) # hide slides 1 and 2
slide_visible(x)
#> [1] FALSE FALSE  TRUE

slide_visible(x, show = 1:2, hide = 3)
slide_visible(x)
#> [1]  TRUE  TRUE FALSE

slide_visible(x) <- FALSE # hide all slides
slide_visible(x)
#> [1] FALSE FALSE FALSE

slide_visible(x)[2] <- TRUE # set 2nd slide to visible
slide_visible(x)
#> [1] FALSE  TRUE FALSE

slide_visible(x)[c(1, 3)] <- TRUE
slide_visible(x)
#> [1] TRUE TRUE TRUE

Created on 2025-01-01 with reprex v2.0.2

@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.10%. Comparing base (c79f2c0) to head (2366f23).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #631      +/-   ##
==========================================
+ Coverage   85.90%   86.10%   +0.20%     
==========================================
  Files          43       43              
  Lines        6967     7032      +65     
==========================================
+ Hits         5985     6055      +70     
+ Misses        982      977       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@markheckmann markheckmann reopened this Dec 31, 2024
@laresbernardo
Copy link

This is exactly what I needed. Thanks for this amazing work on hiding/showing slides @markheckmann Happy New Year!

@davidgohel davidgohel merged commit 1660aec into davidgohel:master Jan 2, 2025
4 checks passed
@davidgohel
Copy link
Owner

thank you @markheckmann ! (and happy new year)

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

Successfully merging this pull request may close these issues.

4 participants