Skip to content

Commit

Permalink
feat: location short forms for ph_with() location arg
Browse files Browse the repository at this point in the history
- Simplified input format for `location` arg in `ph_with_*` functions (#623)

Instead of a `location` object created by the `ph_location_*` function family,
`ph_with_*` functions now resolves certain short form input into corresponding
`location` objects. For example, instead of using `ph_location_label("<label>")`
you can now simply pass the `"<label>"` to the `location` arg. The functionn will
convert the string into the corresponding location object automatically. Other
examples are `"body [1]"` for `ph_location_type(type = "body", type_idx = 1)`,
or the integer `1` for `ph_location_id(id = 1)`.

- export resolve_location() function. It might be helpful if other packages want
to use it in their own wrappers.
  • Loading branch information
markheckmann authored Feb 3, 2025
1 parent 1660aec commit 1d0bc2e
Show file tree
Hide file tree
Showing 19 changed files with 896 additions and 392 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:

name: test-coverage.yaml

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: officer
Title: Manipulation of Microsoft Word and PowerPoint Documents
Version: 0.6.8.004
Version: 0.6.8.005
Authors@R: c(
person("David", "Gohel", , "[email protected]", role = c("aut", "cre")),
person("Stefan", "Moog", , "[email protected]", role = "aut"),
Expand Down
27 changes: 14 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@ S3method(length,rpptx)
S3method(length,rxlsx)
S3method(ph_from_location,location_label)
S3method(ph_from_location,location_type)
S3method(ph_with,block_list)
S3method(ph_with,character)
S3method(ph_with,data.frame)
S3method(ph_with,empty_content)
S3method(ph_with,external_img)
S3method(ph_with,factor)
S3method(ph_with,fpar)
S3method(ph_with,gg)
S3method(ph_with,logical)
S3method(ph_with,numeric)
S3method(ph_with,plot_instr)
S3method(ph_with,unordered_list)
S3method(ph_with,xml_document)
S3method(print,block_caption)
S3method(print,block_pour_docx)
S3method(print,block_section)
Expand Down Expand Up @@ -268,6 +255,19 @@ export(ph_location_type)
export(ph_remove)
export(ph_slidelink)
export(ph_with)
export(ph_with.block_list)
export(ph_with.character)
export(ph_with.data.frame)
export(ph_with.empty_content)
export(ph_with.external_img)
export(ph_with.factor)
export(ph_with.fpar)
export(ph_with.gg)
export(ph_with.logical)
export(ph_with.numeric)
export(ph_with.plot_instr)
export(ph_with.unordered_list)
export(ph_with.xml_document)
export(plot_instr)
export(plot_layout_properties)
export(pptx_summary)
Expand All @@ -277,6 +277,7 @@ export(read_docx)
export(read_pptx)
export(read_xlsx)
export(remove_slide)
export(resolve_location)
export(rtf_add)
export(rtf_doc)
export(run_autonum)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Issues

- Simplified input format for `location` arg in `ph_with_*` functions (#623). Instead of a `location` object
created by the `ph_location_*` function family, `ph_with_*` functions now resolves certain short form
input into corresponding `location` objects. For example, instead of using `ph_location_label("<label>")`
you can now simply pass the `"<label>"` to the `location` arg. The functionn will convert the string into
the corresponding location object automatically. Other examples are `"body [1]"` for
`ph_location_type(type = "body", type_idx = 1)`, or the integer `1` for `ph_location_id(id = 1)`
- Add `slide_visible()` to get and set the visibility of slides (#622).
- debug selector for `ph_remove()` (see #625) that was not working
for rvg outputs.
Expand Down
Loading

0 comments on commit 1d0bc2e

Please sign in to comment.