pptx/slide-master-title-placeholder

The slide master part carries a title-type placeholder shape.

Library verdicts: python-pptx: — pptxjs: —

Metadata

Feature idpptx/slide-master-title-placeholder
Formatpptx
Categoryslide-layout
Spececma-376-5-part-1 § 19.3.1.42 p:ph

XPath assertions

ID / partPredicateXPathpython-pptxpptxjs
master-title-placeholder-present
ppt/slideMasters/slideMaster1.xml
exist
The slide master must carry a shape declaring <p:ph type='title'/> inside <p:nvSpPr>/<p:nvPr>.
//p:sp[p:nvSpPr/p:nvPr/p:ph[@type='title']]

Render assertions

No render assertions declared.

Generator source

scripts/gen_slide_master_title_placeholder.py

#!/usr/bin/env python3
"""Generate ``fixtures/pptx/slide-master-title-placeholder.pptx``.

A minimal presentation whose default slide master carries a title
placeholder shape in ``ppt/slideMasters/slideMaster1.xml``. The feature
under test is the master-level placeholder markup, not a visible slide;
python-pptx's default template already emits the placeholder, so simply
saving a fresh presentation satisfies the assertion.

Designed to satisfy the assertions in
``features/pptx/slide-master-title-placeholder.json``.
"""

from __future__ import annotations

import datetime as _dt
from pathlib import Path

from pptx import Presentation

_REPRODUCIBLE_DT = _dt.datetime(2000, 1, 1, 0, 0, 0)

_REPO_ROOT = Path(__file__).resolve().parent.parent
_OUT = _REPO_ROOT / "fixtures" / "pptx" / "slide-master-title-placeholder.pptx"


def main() -> int:
    prs = Presentation()
    # Touch the slide master to assert the API surface we are documenting.
    master = prs.slide_masters[0]
    assert master is not None
    _OUT.parent.mkdir(parents=True, exist_ok=True)
    prs.save(_OUT, zip_date_time=_REPRODUCIBLE_DT)
    print(_OUT)
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

Manifest (expanded)

{
  "$schema": "../manifest.schema.json",
  "id": "pptx/slide-master-title-placeholder",
  "title": "Slide master title placeholder",
  "format": "pptx",
  "category": "slide-layout",
  "summary": "The slide master part carries a title-type placeholder shape.",
  "spec": {
    "source": "ecma-376-5-part-1",
    "clause": "19.3.1.42",
    "element": "p:ph",
    "rnc_reference": "spec/ecma-376-5/part-1/rnc/PresentationML.rnc",
    "xsd_reference": "spec/ecma-376-5/part-1/xsd/pml.xsd",
    "notes": "PresentationML slide masters declare placeholder shapes via <p:ph> children of <p:nvSpPr>/<p:nvPr>. A master-level title placeholder uses type='title' (not 'ctrTitle' — that form is layout-level). Layouts and slides inherit the placeholder's geometry and default text style from the master. Any conformant presentation must carry at least a title placeholder on slideMaster1."
  },
  "fixtures": {
    "machine": "pptx/slide-master-title-placeholder",
    "office": "pptx/slide-master-title-placeholder"
  },
  "generator": {
    "python": "scripts/gen_slide_master_title_placeholder.py"
  },
  "assertions": [
    {
      "id": "master-title-placeholder-present",
      "part": "ppt/slideMasters/slideMaster1.xml",
      "namespaces": {
        "p": "http://schemas.openxmlformats.org/presentationml/2006/main",
        "a": "http://schemas.openxmlformats.org/drawingml/2006/main"
      },
      "xpath": "//p:sp[p:nvSpPr/p:nvPr/p:ph[@type='title']]",
      "must": "exist",
      "description": "The slide master must carry a shape declaring <p:ph type='title'/> inside <p:nvSpPr>/<p:nvPr>."
    }
  ]
}

Fixture

Download slide-master-title-placeholder.pptx (26.6 KB)

Reference preview

Reference (machine, page 1 PNG)

pptx/slide-master-title-placeholder page 1 reference

Reference PDF


Download PDF Open in PDF.js

Spec notes

PresentationML slide masters declare placeholder shapes via <p:ph> children of <p:nvSpPr>/<p:nvPr>. A master-level title placeholder uses type='title' (not 'ctrTitle' — that form is layout-level). Layouts and slides inherit the placeholder's geometry and default text style from the master. Any conformant presentation must carry at least a title placeholder on slideMaster1.