Skip to content

Commit 959301d

Browse files
committed
doc: enrich officer-package manual
1 parent b0c5e18 commit 959301d

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: pkgdown
77
jobs:
88
pkgdown:
99
runs-on: ubuntu-22.04
10-
if: "contains(github.event.head_commit.message, 'sitedeploy')"
10+
if: "!contains(github.event.head_commit.message, 'ci skip')"
1111
env:
1212
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1313
steps:

R/officer.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,34 @@
1919
#' The package is also providing several objects that can be printed
2020
#' in 'R Markdown' documents for advanced Word or PowerPoint
2121
#' reporting as [run_autonum()] and [block_caption()].
22+
#' @section Get Word content in a data.frame:
23+
#'
24+
#' While officer allows you to generate Word and PowerPoint documents,
25+
#' an important feature is also the ability to read the content of existing
26+
#' Word documents. Use [docx_summary()] to extract document content as a
27+
#' structured data.frame, making it easy to analyze and process Word files
28+
#' programmatically.
29+
#'
30+
#' @section Copy an officer object:
31+
#'
32+
#' 'officer' objects of class `rdocx` or `rpptx` use R6 classes with reference
33+
#' semantics. **Assignment does NOT create a copy**:
34+
#'
35+
#' ```
36+
#' pptx1 <- read_pptx()
37+
#' pptx2 <- pptx1 # pptx2 is a reference to pptx1, not a copy!
38+
#' ```
39+
#'
40+
#' If you need independent documents (e.g., in loops), read the template
41+
#' each time:
42+
#'
43+
#' ```
44+
#' for (i in 1:10) {
45+
#' doc <- read_docx("template.docx") # Read fresh each iteration
46+
#' # ... modify doc ...
47+
#' print(doc, target = paste0("output_", i, ".docx"))
48+
#' }
49+
#' ```
2250
#'
2351
#' @seealso The user documentation: \url{https://ardata-fr.github.io/officeverse/} and
2452
#' manuals \url{https://davidgohel.github.io/officer/}

man/officer.Rd

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)