Skip to content

feat: fix annonate_base() plus more modular approach to ph annotation #682

@markheckmann

Description

@markheckmann

I suggest the below changes to ph annotation.

@davidgohel Please feel free to assign me the issue if you agree with the suggstions :)


1) Fix annotate_base()

  • currently outdated due to missing type index (e.g. body [3])
  • index should be renamed id for coherent terminology across functions (see layout_properties, ph_location_id, etc.),
  • positioning of layout and master name at top right could be more consistent
  • ph visualization could be improved by adding a optional border line by default (+ more options)
  • Some masters I work with have > 30 layouts. It would be good to have an arg to select a subset only

Currently

Missing type index (body[2]), index should be id, unclear which area phs span, misaligned master + layout.

Image

New

Image

2) More modular approach

Personally, I rarely use annotate_base() as it breaks my flow of working. Usually, I want to just quickly see a slide's phs directly. I found, however, that using an experimental phs_annotate() works well for me in conjunction with the recently added print(preview = TRUE) (PR #675)

read_pptx() |>
  add_slide("Title Slide") |>
  phs_annotate() |>  # annotate current slide's placeholders
  print(preview = TRUE)

I suggest these two new functions for a more modular approach ph annotatation:

phs_annotate():

add_annotated_layouts():

  • adds one slide with annotated phs for each layout
  • allows selecting of a subset of layouts only
  • different from annotate_base() it is not yet written but only added to the rpptx object
  • replaces the internals of annotate_base()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions