Layout placeholder management for slide content.
Each slide layout defines named placeholder positions (title, subtitle, content, etc.) that can be filled with text or pictures. This module handles creating placeholder structs and rendering their XML.
Placeholders can be addressed two ways. The bundled template's layouts have
names (:title, :content, ...) listed in placeholders_for/1. Any
template's layouts can be addressed by the {type, idx} pair that
Podium.Template.inspect/1 reports for each placeholder.
Summary
Functions
Creates a text placeholder shape addressed by the layout placeholder's own
{type, idx}, as reported by Podium.Template.inspect/1.
Creates a text placeholder shape for the given placeholder name and text.
Creates a date placeholder at the idx the layout uses for its date.
Creates a footer placeholder at the idx the layout uses for its footer.
Creates a picture placeholder struct addressed by the layout placeholder's own
{type, idx}.
Creates a picture placeholder struct (kind: :picture).
Creates a slide number placeholder at the idx the layout uses for its slide number.
Normalises a placeholder reference to {type, idx} with the OOXML attribute
defaults filled in: a missing type is "obj" and a missing idx is 0.
Returns the known placeholder definitions for a layout.
Generates the XML for a placeholder shape.
Dispatches based on the :kind field.
Types
@type t() :: %Podium.Placeholder{ field_text: String.t() | nil, idx: non_neg_integer() | nil, image_rid: String.t() | nil, kind: :text | :picture | :footer | :date | :slide_number | nil, paragraphs: [map()] | nil, type: String.t() | nil }
Functions
@spec new( {String.t(), non_neg_integer()}, Podium.rich_text() ) :: t()
Creates a text placeholder shape addressed by the layout placeholder's own
{type, idx}, as reported by Podium.Template.inspect/1.
@spec new(atom(), atom(), Podium.rich_text()) :: t()
Creates a text placeholder shape for the given placeholder name and text.
@spec new_date(String.t(), non_neg_integer()) :: t()
Creates a date placeholder at the idx the layout uses for its date.
@spec new_picture({String.t(), non_neg_integer()}) :: t()
Creates a picture placeholder struct addressed by the layout placeholder's own
{type, idx}.
The type is the layout placeholder's, not "pic": PowerPoint leaves a
content placeholder's p:ph alone when a picture is inserted into it, so a
picture in a content placeholder is {"obj", idx}.
Creates a picture placeholder struct (kind: :picture).
@spec new_slide_number(non_neg_integer()) :: t()
Creates a slide number placeholder at the idx the layout uses for its slide number.
@spec normalize_ref(Podium.Template.ref()) :: {String.t(), non_neg_integer()}
Normalises a placeholder reference to {type, idx} with the OOXML attribute
defaults filled in: a missing type is "obj" and a missing idx is 0.
Accepts a {type, idx} tuple, a %Podium.Placeholder{}, or any map with
:type and :idx keys, such as a definition from placeholders_for/1.
Returns the known placeholder definitions for a layout.
Generates the XML for a placeholder shape.
Dispatches based on the :kind field.