Pure readers over a presentation or page from the Slides API: element text, slide titles, speaker notes, placeholders and an outline of the whole deck.
Values
TITLE_TYPES
TITLE_TYPES: Vec [
"TITLE",
"CENTERED_TITLE"
]
Functions
element-text
fn (element: Map): Str
A page element's text, from a shape, a table (cell after cell) or a group (child after child); empty for images, lines and the like.
Example
::google::slides::content/element-text({shape: {text: {textElements: [{textRun: {content: "Hi\n"}}]}}}) // "Hi\n"
::google::slides::content/element-text({image: {contentUrl: "https://example.com/a.png"}}) // ""
find-element
fn (page: Map, object-id: Str): Map?
The element on a page with this objectId, or null. Looks inside
groups.
Example
slide {pageElements: [
{objectId: "t", shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3 review\n"}}]}}},
{objectId: "b", shape: {placeholder: {type: "BODY", index: 0}, text: {textElements: [{textRun: {content: "Revenue up\n"}}]}}}
]}
::google::slides::content/find-element(slide, "t").shape.placeholder.type // "TITLE"
::google::slides::content/find-element(slide, "missing") // null
find-placeholder
fn (page: Map, kind: Str): Map?
The first element on a page whose placeholder type is kind (TITLE,
CENTERED_TITLE, SUBTITLE, BODY, ...), or null. Looks inside
groups.
Example
slide {pageElements: [
{objectId: "t", shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3 review\n"}}]}}},
{objectId: "b", shape: {placeholder: {type: "BODY", index: 0}, text: {textElements: [{textRun: {content: "Revenue up\n"}}]}}}
]}
::google::slides::content/find-placeholder(slide, "BODY").objectId // "b"
::google::slides::content/find-placeholder(slide, "SUBTITLE") // null
outline
fn (presentation: Map): Vec
Every slide of a presentation as {id, title, text, notes}, in order.
text includes the title.
Example
deck {slides: [{objectId: "s1", pageElements: [
{shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3\n"}}]}}}
]}]}
::google::slides::content/outline(deck) // [{id: "s1", title: "Q3", text: "Q3\n", notes: ""}]
slide-outline
fn (slide: Map): Map
One slide as {id, title, text, notes}, the record outline returns
for each slide. Use it on a single page from get-page. text includes
the title.
Example
slide {objectId: "s1", pageElements: [
{shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3\n"}}]}}}
]}
::google::slides::content/slide-outline(slide) // {id: "s1", title: "Q3", text: "Q3\n", notes: ""}
slide-text
fn (slide: Map): Str
All text on a slide, element after element, including the title.
Example
slide {pageElements: [
{objectId: "t", shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3 review\n"}}]}}},
{objectId: "b", shape: {placeholder: {type: "BODY", index: 0}, text: {textElements: [{textRun: {content: "Revenue up\n"}}]}}}
]}
::google::slides::content/slide-text(slide) // "Q3 review\nRevenue up\n"
slide-title
fn (slide: Map): Str?
A slide's title placeholder text, trimmed; null when it has no title placeholder. Looks inside groups.
Example
slide {pageElements: [
{objectId: "t", shape: {placeholder: {type: "TITLE", index: 0}, text: {textElements: [{textRun: {content: "Q3 review\n"}}]}}},
{objectId: "b", shape: {placeholder: {type: "BODY", index: 0}, text: {textElements: [{textRun: {content: "Revenue up\n"}}]}}}
]}
::google::slides::content/slide-title(slide) // "Q3 review"
::google::slides::content/slide-title({}) // null
speaker-notes
fn (slide: Map): Str
A slide's speaker notes, trimmed; empty when it has none.
Example
slide {slideProperties: {notesPage: {
notesProperties: {speakerNotesObjectId: "n"},
pageElements: [{objectId: "n", shape: {text: {textElements: [{textRun: {content: " Say hi \n"}}]}}}]
}}}
::google::slides::content/speaker-notes(slide) // "Say hi"
::google::slides::content/speaker-notes({}) // ""
text-content
fn (text: Any): Str
A TextContent's text: its text runs and auto text joined.
Example
::google::slides::content/text-content({textElements: [
{paragraphMarker: {}},
{textRun: {content: "Slide "}},
{autoText: {content: "3"}}
]}) // "Slide 3"
::google::slides::content/text-content(null) // ""